Add attributes to namespace decls.

llvm-svn: 95510
This commit is contained in:
Anders Carlsson 2010-02-07 01:09:23 +00:00
parent 9878f9f73b
commit a7bcade229
5 changed files with 12 additions and 6 deletions

View File

@ -1277,7 +1277,8 @@ public:
/// definition.
virtual DeclPtrTy ActOnStartNamespaceDef(Scope *S, SourceLocation IdentLoc,
IdentifierInfo *Ident,
SourceLocation LBrace) {
SourceLocation LBrace,
AttributeList *AttrList) {
return DeclPtrTy();
}

View File

@ -684,7 +684,8 @@ namespace {
virtual DeclPtrTy ActOnStartNamespaceDef(Scope *S, SourceLocation IdentLoc,
IdentifierInfo *Ident,
SourceLocation LBrace) {
SourceLocation LBrace,
AttributeList *AttrList) {
Out << __FUNCTION__ << "\n";
return DeclPtrTy();
}

View File

@ -64,7 +64,7 @@ Parser::DeclPtrTy Parser::ParseNamespace(unsigned Context,
}
// Read label attributes, if present.
Action::AttrTy *AttrList = 0;
AttributeList *AttrList = 0;
if (Tok.is(tok::kw___attribute)) {
attrTok = Tok;
@ -91,7 +91,7 @@ Parser::DeclPtrTy Parser::ParseNamespace(unsigned Context,
ParseScope NamespaceScope(this, Scope::DeclScope);
DeclPtrTy NamespcDecl =
Actions.ActOnStartNamespaceDef(CurScope, IdentLoc, Ident, LBrace);
Actions.ActOnStartNamespaceDef(CurScope, IdentLoc, Ident, LBrace, AttrList);
PrettyStackTraceActionsDecl CrashInfo(NamespcDecl, NamespaceLoc, Actions,
PP.getSourceManager(),

View File

@ -1829,7 +1829,8 @@ public:
// Act on C++ namespaces
virtual DeclPtrTy ActOnStartNamespaceDef(Scope *S, SourceLocation IdentLoc,
IdentifierInfo *Ident,
SourceLocation LBrace);
SourceLocation LBrace,
AttributeList *AttrList);
virtual void ActOnFinishNamespaceDef(DeclPtrTy Dcl, SourceLocation RBrace);
virtual DeclPtrTy ActOnUsingDirective(Scope *CurScope,

View File

@ -2821,13 +2821,16 @@ Sema::DeclPtrTy Sema::ActOnConversionDeclarator(CXXConversionDecl *Conversion) {
Sema::DeclPtrTy Sema::ActOnStartNamespaceDef(Scope *NamespcScope,
SourceLocation IdentLoc,
IdentifierInfo *II,
SourceLocation LBrace) {
SourceLocation LBrace,
AttributeList *AttrList) {
NamespaceDecl *Namespc =
NamespaceDecl::Create(Context, CurContext, IdentLoc, II);
Namespc->setLBracLoc(LBrace);
Scope *DeclRegionScope = NamespcScope->getParent();
ProcessDeclAttributeList(DeclRegionScope, Namespc, AttrList);
if (II) {
// C++ [namespace.def]p2:
// The identifier in an original-namespace-definition shall not have been