aboutsummaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorDouglas Gregor <dgregor@apple.com>2010-03-29 14:42:08 +0000
committerDouglas Gregor <dgregor@apple.com>2010-03-29 14:42:08 +0000
commit0b4c9b5834a0a5520d2cd32227a53cf7f73fedca (patch)
treea942a1789d530f9f7f3c8a806a5a0a9efbc5817e /lib
parent67d568aaeba023e42ca74da3dca18e161664f567 (diff)
Support __attribute__((packed)) (along with other attributes) at the
end of a struct/class/union in C++, from Justin Bogner! git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@99811 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib')
-rw-r--r--lib/Parse/ParseDeclCXX.cpp5
-rw-r--r--lib/Sema/Sema.h3
-rw-r--r--lib/Sema/SemaDeclCXX.cpp5
3 files changed, 8 insertions, 5 deletions
diff --git a/lib/Parse/ParseDeclCXX.cpp b/lib/Parse/ParseDeclCXX.cpp
index 9e232cbf32..3dc6ad9b34 100644
--- a/lib/Parse/ParseDeclCXX.cpp
+++ b/lib/Parse/ParseDeclCXX.cpp
@@ -1579,10 +1579,11 @@ void Parser::ParseCXXMemberSpecification(SourceLocation RecordLoc,
// If attributes exist after class contents, parse them.
llvm::OwningPtr<AttributeList> AttrList;
if (Tok.is(tok::kw___attribute))
- AttrList.reset(ParseGNUAttributes()); // FIXME: where should I put them?
+ AttrList.reset(ParseGNUAttributes());
Actions.ActOnFinishCXXMemberSpecification(CurScope, RecordLoc, TagDecl,
- LBraceLoc, RBraceLoc);
+ LBraceLoc, RBraceLoc,
+ AttrList.get());
// C++ 9.2p2: Within the class member-specification, the class is regarded as
// complete within function bodies, default arguments,
diff --git a/lib/Sema/Sema.h b/lib/Sema/Sema.h
index d0a4f7cbf6..9c661ba1b1 100644
--- a/lib/Sema/Sema.h
+++ b/lib/Sema/Sema.h
@@ -2502,7 +2502,8 @@ public:
virtual void ActOnFinishCXXMemberSpecification(Scope* S, SourceLocation RLoc,
DeclPtrTy TagDecl,
SourceLocation LBrac,
- SourceLocation RBrac);
+ SourceLocation RBrac,
+ AttributeList *AttrList);
virtual void ActOnReenterTemplateScope(Scope *S, DeclPtrTy Template);
virtual void ActOnStartDelayedMemberDeclarations(Scope *S,
diff --git a/lib/Sema/SemaDeclCXX.cpp b/lib/Sema/SemaDeclCXX.cpp
index b5dc730522..ee16b9c4b1 100644
--- a/lib/Sema/SemaDeclCXX.cpp
+++ b/lib/Sema/SemaDeclCXX.cpp
@@ -2174,7 +2174,8 @@ void Sema::CheckCompletedCXXClass(CXXRecordDecl *Record) {
void Sema::ActOnFinishCXXMemberSpecification(Scope* S, SourceLocation RLoc,
DeclPtrTy TagDecl,
SourceLocation LBrac,
- SourceLocation RBrac) {
+ SourceLocation RBrac,
+ AttributeList *AttrList) {
if (!TagDecl)
return;
@@ -2182,7 +2183,7 @@ void Sema::ActOnFinishCXXMemberSpecification(Scope* S, SourceLocation RLoc,
ActOnFields(S, RLoc, TagDecl,
(DeclPtrTy*)FieldCollector->getCurFields(),
- FieldCollector->getCurNumFields(), LBrac, RBrac, 0);
+ FieldCollector->getCurNumFields(), LBrac, RBrac, AttrList);
CheckCompletedCXXClass(
dyn_cast_or_null<CXXRecordDecl>(TagDecl.getAs<Decl>()));