summaryrefslogtreecommitdiffstats
path: root/clang/lib/Sema/SemaDecl.cpp
diff options
context:
space:
mode:
authorDouglas Gregor <dgregor@apple.com>2011-10-09 20:59:17 +0000
committerDouglas Gregor <dgregor@apple.com>2011-10-09 20:59:17 +0000
commite9d075e4341fd50f699b54adff57cd3efe86d4d5 (patch)
treecde0066a31bc55ff266e311b7629aa542651aadb /clang/lib/Sema/SemaDecl.cpp
parent668d3625030b37a340af05da9c8da0d79179698c (diff)
downloadbcm5719-llvm-e9d075e4341fd50f699b54adff57cd3efe86d4d5.tar.gz
bcm5719-llvm-e9d075e4341fd50f699b54adff57cd3efe86d4d5.zip
A friend template specialization is also dependent if any of its
template arguments are dependent. Fixes PR10913. llvm-svn: 141515
Diffstat (limited to 'clang/lib/Sema/SemaDecl.cpp')
-rw-r--r--clang/lib/Sema/SemaDecl.cpp6
1 files changed, 5 insertions, 1 deletions
diff --git a/clang/lib/Sema/SemaDecl.cpp b/clang/lib/Sema/SemaDecl.cpp
index 451751f1430..5ba38ee9f23 100644
--- a/clang/lib/Sema/SemaDecl.cpp
+++ b/clang/lib/Sema/SemaDecl.cpp
@@ -4987,8 +4987,12 @@ Sema::ActOnFunctionDeclarator(Scope *S, Declarator &D, DeclContext *DC,
// that either the specialized function type or the specialized
// template is dependent, and therefore matching will fail. In
// this case, don't check the specialization yet.
+ bool InstantiationDependent = false;
if (isFunctionTemplateSpecialization && isFriend &&
- (NewFD->getType()->isDependentType() || DC->isDependentContext())) {
+ (NewFD->getType()->isDependentType() || DC->isDependentContext() ||
+ TemplateSpecializationType::anyDependentTemplateArguments(
+ TemplateArgs.getArgumentArray(), TemplateArgs.size(),
+ InstantiationDependent))) {
assert(HasExplicitTemplateArgs &&
"friend function specialization without template args");
if (CheckDependentFunctionTemplateSpecialization(NewFD, TemplateArgs,
OpenPOWER on IntegriCloud