diff options
Diffstat (limited to 'lib')
-rw-r--r-- | lib/Frontend/PrintParserCallbacks.cpp | 3 | ||||
-rw-r--r-- | lib/Parse/ParseDecl.cpp | 3 | ||||
-rw-r--r-- | lib/Parse/ParseDeclCXX.cpp | 2 | ||||
-rw-r--r-- | lib/Sema/Sema.h | 3 | ||||
-rw-r--r-- | lib/Sema/SemaDecl.cpp | 8 |
5 files changed, 13 insertions, 6 deletions
diff --git a/lib/Frontend/PrintParserCallbacks.cpp b/lib/Frontend/PrintParserCallbacks.cpp index 73530ef58d..ca13f3df29 100644 --- a/lib/Frontend/PrintParserCallbacks.cpp +++ b/lib/Frontend/PrintParserCallbacks.cpp @@ -116,7 +116,8 @@ namespace { /// FinalizeDeclaratorGroup - After a sequence of declarators are parsed, /// this gives the actions implementation a chance to process the group as /// a whole. - virtual DeclGroupPtrTy FinalizeDeclaratorGroup(Scope *S, DeclPtrTy *Group, + virtual DeclGroupPtrTy FinalizeDeclaratorGroup(Scope *S, const DeclSpec& DS, + DeclPtrTy *Group, unsigned NumDecls) { Out << __FUNCTION__ << "\n"; return DeclGroupPtrTy(); diff --git a/lib/Parse/ParseDecl.cpp b/lib/Parse/ParseDecl.cpp index 54e70be16e..b667014efc 100644 --- a/lib/Parse/ParseDecl.cpp +++ b/lib/Parse/ParseDecl.cpp @@ -437,7 +437,8 @@ ParseInitDeclaratorListAfterFirstDeclarator(Declarator &D) { ParseDeclarator(D); } - return Actions.FinalizeDeclaratorGroup(CurScope, DeclsInGroup.data(), + return Actions.FinalizeDeclaratorGroup(CurScope, D.getDeclSpec(), + DeclsInGroup.data(), DeclsInGroup.size()); } diff --git a/lib/Parse/ParseDeclCXX.cpp b/lib/Parse/ParseDeclCXX.cpp index cfbd9097f7..7cbd72bed4 100644 --- a/lib/Parse/ParseDeclCXX.cpp +++ b/lib/Parse/ParseDeclCXX.cpp @@ -970,7 +970,7 @@ void Parser::ParseCXXClassMemberDeclaration(AccessSpecifier AS) { if (Tok.is(tok::semi)) { ConsumeToken(); - Actions.FinalizeDeclaratorGroup(CurScope, DeclsInGroup.data(), + Actions.FinalizeDeclaratorGroup(CurScope, DS, DeclsInGroup.data(), DeclsInGroup.size()); return; } diff --git a/lib/Sema/Sema.h b/lib/Sema/Sema.h index fae5a92747..75632d560e 100644 --- a/lib/Sema/Sema.h +++ b/lib/Sema/Sema.h @@ -410,7 +410,8 @@ public: void AddInitializerToDecl(DeclPtrTy dcl, ExprArg init, bool DirectInit); void ActOnUninitializedDecl(DeclPtrTy dcl); virtual void SetDeclDeleted(DeclPtrTy dcl, SourceLocation DelLoc); - virtual DeclGroupPtrTy FinalizeDeclaratorGroup(Scope *S, DeclPtrTy *Group, + virtual DeclGroupPtrTy FinalizeDeclaratorGroup(Scope *S, const DeclSpec &DS, + DeclPtrTy *Group, unsigned NumDecls); virtual void ActOnFinishKNRParamDeclarations(Scope *S, Declarator &D, SourceLocation LocAfterDecls); diff --git a/lib/Sema/SemaDecl.cpp b/lib/Sema/SemaDecl.cpp index 6a2e3099cd..8bd753abea 100644 --- a/lib/Sema/SemaDecl.cpp +++ b/lib/Sema/SemaDecl.cpp @@ -2754,10 +2754,14 @@ void Sema::ActOnUninitializedDecl(DeclPtrTy dcl) { } } -Sema::DeclGroupPtrTy Sema::FinalizeDeclaratorGroup(Scope *S, DeclPtrTy *Group, +Sema::DeclGroupPtrTy Sema::FinalizeDeclaratorGroup(Scope *S, const DeclSpec &DS, + DeclPtrTy *Group, unsigned NumDecls) { llvm::SmallVector<Decl*, 8> Decls; - + + if (DS.isTypeSpecOwned()) + Decls.push_back((Decl*)DS.getTypeRep()); + for (unsigned i = 0; i != NumDecls; ++i) if (Decl *D = Group[i].getAs<Decl>()) Decls.push_back(D); |