[cfe-commits] r163208 - /cfe/trunk/lib/Sema/SemaTemplateInstantiateDecl.cpp

Abramo Bagnara abramo.bagnara at gmail.com
Wed Sep 5 02:55:11 PDT 2012


Author: abramo
Date: Wed Sep  5 04:55:10 2012
New Revision: 163208

URL: http://llvm.org/viewvc/llvm-project?rev=163208&view=rev
Log:
Do not add using directives to a function decl context when instantiating.

Modified:
    cfe/trunk/lib/Sema/SemaTemplateInstantiateDecl.cpp

Modified: cfe/trunk/lib/Sema/SemaTemplateInstantiateDecl.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Sema/SemaTemplateInstantiateDecl.cpp?rev=163208&r1=163207&r2=163208&view=diff
==============================================================================
--- cfe/trunk/lib/Sema/SemaTemplateInstantiateDecl.cpp (original)
+++ cfe/trunk/lib/Sema/SemaTemplateInstantiateDecl.cpp Wed Sep  5 04:55:10 2012
@@ -1813,7 +1813,12 @@
                                  D->getIdentLocation(),
                                  D->getNominatedNamespace(),
                                  D->getCommonAncestor());
-  Owner->addDecl(Inst);
+
+  // Add the using directive to its declaration context
+  // only if this is not a function or method.
+  if (!Owner->isFunctionOrMethod())
+    Owner->addDecl(Inst);
+
   return Inst;
 }
 





More information about the cfe-commits mailing list