// from being visible?
if (isa<ClassTemplateSpecializationDecl>(D))
return;
+ if (FunctionDecl *FD = dyn_cast<FunctionDecl>(D))
+ if (FD->isFunctionTemplateSpecialization())
+ return;
DeclContext *PrimaryContext = getPrimaryContext();
if (PrimaryContext != this) {
// scope.
if ((isa<FunctionTemplateDecl>(D) &&
cast<FunctionTemplateDecl>(D)->getTemplatedDecl()->isOutOfLine()) ||
- (isa<FunctionDecl>(D) && cast<FunctionDecl>(D)->isOutOfLine()) ||
+ (isa<FunctionDecl>(D) &&
+ (cast<FunctionDecl>(D)->isFunctionTemplateSpecialization() ||
+ cast<FunctionDecl>(D)->isOutOfLine())) ||
(isa<VarDecl>(D) && cast<VarDecl>(D)->isOutOfLine()))
return;
// If this has an identifier and is not an invalid redeclaration or
// function template specialization, add it to the scope stack.
- if (Name && !(Redeclaration && New->isInvalidDecl()) &&
- !(isa<FunctionDecl>(New) &&
- cast<FunctionDecl>(New)->isFunctionTemplateSpecialization()))
+ if (Name && !(Redeclaration && New->isInvalidDecl()))
PushOnScopeChains(New, S);
return DeclPtrTy::make(New);
--- /dev/null
+// RUN: clang-cc -emit-llvm %s -o - | FileCheck %s
+
+template<typename T> void a(T);
+template<> void a(int) {}
+
+// CHECK: define void @_Z1aIiEvT_
+
+namespace X {
+template<typename T> void b(T);
+template<> void b(int) {}
+}
+
+// CHECK: define void @_ZN1X1bIiEEvT_