]> granicus.if.org Git - clang/commitdiff
Add attributes to namespace decls.
authorAnders Carlsson <andersca@mac.com>
Sun, 7 Feb 2010 01:09:23 +0000 (01:09 +0000)
committerAnders Carlsson <andersca@mac.com>
Sun, 7 Feb 2010 01:09:23 +0000 (01:09 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@95510 91177308-0d34-0410-b5e6-96231b3b80d8

include/clang/Parse/Action.h
lib/Frontend/PrintParserCallbacks.cpp
lib/Parse/ParseDeclCXX.cpp
lib/Sema/Sema.h
lib/Sema/SemaDeclCXX.cpp

index 91854aa480cc4c586712162bb3ed3e57d1798901..ec542f08c303f24087d8b6bab784832c13348247 100644 (file)
@@ -1277,7 +1277,8 @@ public:
   /// definition.
   virtual DeclPtrTy ActOnStartNamespaceDef(Scope *S, SourceLocation IdentLoc,
                                            IdentifierInfo *Ident,
-                                           SourceLocation LBrace) {
+                                           SourceLocation LBrace,
+                                           AttributeList *AttrList) {
     return DeclPtrTy();
   }
 
index 6af33c20a6453f87805cc34397014972a6d78d41..8d64a64133048fb8676932618efc908135186515 100644 (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();
     }
index 07bae1c7a4b7bfdf6c11f01321fe9107d4cff0f8..c24bafd6d3b3bcaf295fa52b04bd90eae6378c9d 100644 (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(),
index dfd8f3461eb912dbbddca1f0fa3eb7fd76ed7f0c..6a3ed3d0b732994135af1a4876f997c1dc9ea144 100644 (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,
index 7fbbed40890ac075700794dea48c56f0444a5634..e156b62fdb8d8920491eedd0b39524c9bc09733c 100644 (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