diff options
author | Douglas Gregor <dgregor@apple.com> | 2011-03-05 20:06:51 +0000 |
---|---|---|
committer | Douglas Gregor <dgregor@apple.com> | 2011-03-05 20:06:51 +0000 |
commit | 9d9f8db4bc988b4493eaf2db2b8bd89cdca31f6a (patch) | |
tree | 14cf5db2e6dcc213a66d78bbc965db6b8b4e2206 /clang/lib/Sema/SemaTemplateInstantiate.cpp | |
parent | 42fc943f21237035ab89e694721c5e704e571d2c (diff) | |
download | bcm5719-llvm-9d9f8db4bc988b4493eaf2db2b8bd89cdca31f6a.tar.gz bcm5719-llvm-9d9f8db4bc988b4493eaf2db2b8bd89cdca31f6a.zip |
When substituting in for a template name, do not produce a qualified
template name as the result of substitution. The qualifier is handled
separately by the tree transformer, so we would end up in an
inconsistent state.
This is actually the last bit of PR9016, and possibly also fixes
PR8965. It takes Boost.Icl from "epic fail" down to a single failure.
llvm-svn: 127108
Diffstat (limited to 'clang/lib/Sema/SemaTemplateInstantiate.cpp')
-rw-r--r-- | clang/lib/Sema/SemaTemplateInstantiate.cpp | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/clang/lib/Sema/SemaTemplateInstantiate.cpp b/clang/lib/Sema/SemaTemplateInstantiate.cpp index 4108e9fd6fa..6fb6ea270b6 100644 --- a/clang/lib/Sema/SemaTemplateInstantiate.cpp +++ b/clang/lib/Sema/SemaTemplateInstantiate.cpp @@ -967,6 +967,13 @@ TemplateName TemplateInstantiator::TransformTemplateName(CXXScopeSpec &SS, TemplateName Template = Arg.getAsTemplate(); assert(!Template.isNull() && Template.getAsTemplateDecl() && "Wrong kind of template template argument"); + + // We don't ever want to substitute for a qualified template name, since + // the qualifier is handled separately. So, look through the qualified + // template name to its underlying declaration. + if (QualifiedTemplateName *QTN = Template.getAsQualifiedTemplateName()) + Template = TemplateName(QTN->getTemplateDecl()); + return Template; } } |