[cfe-commits] r67965 - /cfe/trunk/include/clang/AST/DeclCXX.h

Anders Carlsson andersca at mac.com
Sat Mar 28 16:50:19 PDT 2009


Author: andersca
Date: Sat Mar 28 18:50:18 2009
New Revision: 67965

URL: http://llvm.org/viewvc/llvm-project?rev=67965&view=rev
Log:
Handle the case where the namespace decl is an alias.

Modified:
    cfe/trunk/include/clang/AST/DeclCXX.h

Modified: cfe/trunk/include/clang/AST/DeclCXX.h
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/include/clang/AST/DeclCXX.h?rev=67965&r1=67964&r2=67965&view=diff

==============================================================================
--- cfe/trunk/include/clang/AST/DeclCXX.h (original)
+++ cfe/trunk/include/clang/AST/DeclCXX.h Sat Mar 28 18:50:18 2009
@@ -973,7 +973,9 @@
 public:
 
   NamespaceDecl *getNamespace() {
-    // FIXME: Namespace can also be an alias decl.
+    if (NamespaceAliasDecl *AD = dyn_cast<NamespaceAliasDecl>(Namespace))
+      return AD->getNamespace();
+
     return cast<NamespaceDecl>(Namespace);
   }
   





More information about the cfe-commits mailing list