aboutsummaryrefslogtreecommitdiff
path: root/lib/AST/TemplateBase.cpp
diff options
context:
space:
mode:
authorDouglas Gregor <dgregor@apple.com>2009-11-11 16:39:34 +0000
committerDouglas Gregor <dgregor@apple.com>2009-11-11 16:39:34 +0000
commit7bb87fca7d22a8a194d04188746b90f46512975f (patch)
treeeb50a180a24ea30e45519b36021acd5512e3b218 /lib/AST/TemplateBase.cpp
parentd694485f9d6e3ea7b458df8241dfffd38f62aca8 (diff)
Fix speculative parsing of dependent template names in
nested-name-specifiers so that they don't gobble the template name (or operator-function-id) unless there is also a template-argument-list. For example, given T::template apply we would previously consume both "template" and "apply" as part of parsing the nested-name-specifier, then error when we see that there is no "<" starting a template argument list. Now, we parse such constructs tentatively, and back off if the "<" is not present. This allows us to parse dependent template names as one would use them for, e.g., template template parameters: template<typename T, template<class> class X = T::template apply> struct MetaSomething; Also, test default arguments for template template parameters. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@86841 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/AST/TemplateBase.cpp')
-rw-r--r--lib/AST/TemplateBase.cpp3
1 files changed, 2 insertions, 1 deletions
diff --git a/lib/AST/TemplateBase.cpp b/lib/AST/TemplateBase.cpp
index 18a574c89c..ff02f9a31c 100644
--- a/lib/AST/TemplateBase.cpp
+++ b/lib/AST/TemplateBase.cpp
@@ -59,7 +59,8 @@ void TemplateArgument::Profile(llvm::FoldingSetNodeID &ID,
break;
case Template:
- ID.AddPointer(getAsTemplate().getAsVoidPointer());
+ ID.AddPointer(Context.getCanonicalTemplateName(getAsTemplate())
+ .getAsVoidPointer());
break;
case Integral: