summaryrefslogtreecommitdiffstats
path: root/clang/lib/Parse
diff options
context:
space:
mode:
Diffstat (limited to 'clang/lib/Parse')
-rw-r--r--clang/lib/Parse/ParseDecl.cpp3
-rw-r--r--clang/lib/Parse/ParseStmt.cpp19
2 files changed, 15 insertions, 7 deletions
diff --git a/clang/lib/Parse/ParseDecl.cpp b/clang/lib/Parse/ParseDecl.cpp
index 438c6f8cf59..20d8f711ae1 100644
--- a/clang/lib/Parse/ParseDecl.cpp
+++ b/clang/lib/Parse/ParseDecl.cpp
@@ -3890,6 +3890,9 @@ bool Parser::isDeclarationSpecifier(bool DisambiguatingWithExpression) {
case tok::kw_explicit:
case tok::kw__Noreturn:
+ // alignment-specifier
+ case tok::kw__Alignas:
+
// friend keyword.
case tok::kw_friend:
diff --git a/clang/lib/Parse/ParseStmt.cpp b/clang/lib/Parse/ParseStmt.cpp
index 0a1eccaa765..8b026e859f6 100644
--- a/clang/lib/Parse/ParseStmt.cpp
+++ b/clang/lib/Parse/ParseStmt.cpp
@@ -2156,14 +2156,13 @@ StmtResult Parser::ParseCXXTryBlockCommon(SourceLocation TryLoc, bool FnTry) {
/// ParseCXXCatchBlock - Parse a C++ catch block, called handler in the standard
///
-/// handler:
-/// 'catch' '(' exception-declaration ')' compound-statement
+/// handler:
+/// 'catch' '(' exception-declaration ')' compound-statement
///
-/// exception-declaration:
-/// type-specifier-seq declarator
-/// type-specifier-seq abstract-declarator
-/// type-specifier-seq
-/// '...'
+/// exception-declaration:
+/// attribute-specifier-seq[opt] type-specifier-seq declarator
+/// attribute-specifier-seq[opt] type-specifier-seq abstract-declarator[opt]
+/// '...'
///
StmtResult Parser::ParseCXXCatchBlock(bool FnCatch) {
assert(Tok.is(tok::kw_catch) && "Expected 'catch'");
@@ -2184,9 +2183,15 @@ StmtResult Parser::ParseCXXCatchBlock(bool FnCatch) {
// without default arguments.
Decl *ExceptionDecl = 0;
if (Tok.isNot(tok::ellipsis)) {
+ ParsedAttributesWithRange Attributes(AttrFactory);
+ MaybeParseCXX11Attributes(Attributes);
+
DeclSpec DS(AttrFactory);
+ DS.takeAttributesFrom(Attributes);
+
if (ParseCXXTypeSpecifierSeq(DS))
return StmtError();
+
Declarator ExDecl(DS, Declarator::CXXCatchContext);
ParseDeclarator(ExDecl);
ExceptionDecl = Actions.ActOnExceptionDeclarator(getCurScope(), ExDecl);
OpenPOWER on IntegriCloud