[PATCH] AST: Don't treat a TemplateExpansion as a Template
David Majnemer
david.majnemer at gmail.com
Tue Aug 27 17:00:34 PDT 2013
- Address review comments
Hi rsmith, doug.gregor,
http://llvm-reviews.chandlerc.com/D1512
CHANGE SINCE LAST DIFF
http://llvm-reviews.chandlerc.com/D1512?vs=3745&id=3841#toc
BRANCH
PR16997
ARCANIST PROJECT
clang
Files:
lib/AST/TypeLoc.cpp
test/SemaTemplate/temp_arg_template.cpp
Index: lib/AST/TypeLoc.cpp
===================================================================
--- lib/AST/TypeLoc.cpp
+++ lib/AST/TypeLoc.cpp
@@ -378,18 +378,16 @@
case TemplateArgument::Template:
case TemplateArgument::TemplateExpansion: {
NestedNameSpecifierLocBuilder Builder;
- TemplateName Template = Args[i].getAsTemplate();
+ TemplateName Template = Args[i].getAsTemplateOrTemplatePattern();
if (DependentTemplateName *DTN = Template.getAsDependentTemplateName())
Builder.MakeTrivial(Context, DTN->getQualifier(), Loc);
else if (QualifiedTemplateName *QTN = Template.getAsQualifiedTemplateName())
Builder.MakeTrivial(Context, QTN->getQualifier(), Loc);
-
+
ArgInfos[i] = TemplateArgumentLocInfo(
- Builder.getWithLocInContext(Context),
- Loc,
- Args[i].getKind() == TemplateArgument::Template
- ? SourceLocation()
- : Loc);
+ Builder.getWithLocInContext(Context), Loc,
+ Args[i].getKind() == TemplateArgument::Template ? SourceLocation()
+ : Loc);
break;
}
Index: test/SemaTemplate/temp_arg_template.cpp
===================================================================
--- test/SemaTemplate/temp_arg_template.cpp
+++ test/SemaTemplate/temp_arg_template.cpp
@@ -60,3 +60,14 @@
struct unbox_args {
typedef typename Primitive::template call<F> x;
};
+
+template <template <typename> class... Templates>
+struct template_tuple {};
+template <typename T>
+struct identity {};
+template <template <typename> class... Templates>
+template_tuple<Templates...> f7() {}
+
+void foo() {
+ f7<identity>();
+}
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D1512.2.patch
Type: text/x-patch
Size: 1878 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20130827/066e38b7/attachment.bin>
More information about the cfe-commits
mailing list