diff options
author | Richard Smith <richard-llvm@metafoo.co.uk> | 2013-02-20 19:22:51 +0000 |
---|---|---|
committer | Richard Smith <richard-llvm@metafoo.co.uk> | 2013-02-20 19:22:51 +0000 |
commit | 6b3d3e54c003b03f16e235ad2ff49e95587bbf92 (patch) | |
tree | 81d295f0e5e6912c0036d7a9bb824e3a91ebe4f1 /lib/Parse/Parser.cpp | |
parent | 2ec6cfcfa00832b015c7a2018884d95ef15f4477 (diff) |
Process and handle attributes on conditions and for loop variables. Process and
diagnose attributes on alias declarations, using directives, and attribute
declarations.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@175649 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Parse/Parser.cpp')
-rw-r--r-- | lib/Parse/Parser.cpp | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/lib/Parse/Parser.cpp b/lib/Parse/Parser.cpp index 1a667daab7..2d8d5b1322 100644 --- a/lib/Parse/Parser.cpp +++ b/lib/Parse/Parser.cpp @@ -566,7 +566,6 @@ bool Parser::ParseTopLevelDecl(DeclGroupPtrTy &Result) { /// external-declaration: [C99 6.9], declaration: [C++ dcl.dcl] /// function-definition /// declaration -/// [C++0x] empty-declaration /// [GNU] asm-definition /// [GNU] __extension__ external-declaration /// [OBJC] objc-class-definition @@ -578,8 +577,10 @@ bool Parser::ParseTopLevelDecl(DeclGroupPtrTy &Result) { /// [C++] linkage-specification /// [GNU] asm-definition: /// simple-asm-expr ';' +/// [C++11] empty-declaration +/// [C++11] attribute-declaration /// -/// [C++0x] empty-declaration: +/// [C++11] empty-declaration: /// ';' /// /// [C++0x/GNU] 'extern' 'template' declaration @@ -624,6 +625,13 @@ Parser::ParseExternalDeclaration(ParsedAttributesWithRange &attrs, HandlePragmaOpenCLExtension(); return DeclGroupPtrTy(); case tok::semi: + // Either a C++11 empty-declaration or attribute-declaration. + if (attrs.Range.isValid()) { + // FIXME: Add an AST representation for this. + Actions.ActOnAttributeDeclaration(attrs.getList()); + return DeclGroupPtrTy(); + } + ConsumeExtraSemi(OutsideFunction); // TODO: Invoke action for top-level semicolon. return DeclGroupPtrTy(); |