r241180 - [modules] Skip trailing attributes when skipping a class definition during parse-merging.
Richard Smith
richard-llvm at metafoo.co.uk
Wed Jul 1 11:56:50 PDT 2015
Author: rsmith
Date: Wed Jul 1 13:56:50 2015
New Revision: 241180
URL: http://llvm.org/viewvc/llvm-project?rev=241180&view=rev
Log:
[modules] Skip trailing attributes when skipping a class definition during parse-merging.
Modified:
cfe/trunk/lib/Parse/ParseDeclCXX.cpp
cfe/trunk/test/Modules/Inputs/submodules-merge-defs/defs.h
Modified: cfe/trunk/lib/Parse/ParseDeclCXX.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Parse/ParseDeclCXX.cpp?rev=241180&r1=241179&r2=241180&view=diff
==============================================================================
--- cfe/trunk/lib/Parse/ParseDeclCXX.cpp (original)
+++ cfe/trunk/lib/Parse/ParseDeclCXX.cpp Wed Jul 1 13:56:50 2015
@@ -2769,6 +2769,11 @@ void Parser::SkipCXXMemberSpecification(
BalancedDelimiterTracker T(*this, tok::l_brace);
T.consumeOpen();
T.skipToEnd();
+
+ // Parse and discard any trailing attributes.
+ ParsedAttributes Attrs(AttrFactory);
+ if (Tok.is(tok::kw___attribute))
+ MaybeParseGNUAttributes(Attrs);
}
/// ParseCXXMemberSpecification - Parse the class definition.
Modified: cfe/trunk/test/Modules/Inputs/submodules-merge-defs/defs.h
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/Modules/Inputs/submodules-merge-defs/defs.h?rev=241180&r1=241179&r2=241180&view=diff
==============================================================================
--- cfe/trunk/test/Modules/Inputs/submodules-merge-defs/defs.h (original)
+++ cfe/trunk/test/Modules/Inputs/submodules-merge-defs/defs.h Wed Jul 1 13:56:50 2015
@@ -80,3 +80,7 @@ namespace SeparateInline {
void f() {}
constexpr int g() { return 0; }
}
+
+namespace TrailingAttributes {
+ template<typename T> struct X {} __attribute__((aligned(8)));
+}
More information about the cfe-commits
mailing list