diff options
author | David Majnemer <david.majnemer@gmail.com> | 2013-08-28 23:48:32 +0000 |
---|---|---|
committer | David Majnemer <david.majnemer@gmail.com> | 2013-08-28 23:48:32 +0000 |
commit | 8918920a329506ea76693876cc8f23af145a6aaa (patch) | |
tree | 12cffd36b8397a1e04b4ad0b9aca982ff2046519 /clang/test/CodeGenCXX/mangle.cpp | |
parent | 4c459bcd472c32e68654c0ffea48a5978819c4e7 (diff) | |
download | bcm5719-llvm-8918920a329506ea76693876cc8f23af145a6aaa.tar.gz bcm5719-llvm-8918920a329506ea76693876cc8f23af145a6aaa.zip |
Sema: Subst type default template args earlier
Summary:
We would not perform substitution at an appropriate point, allowing strange
results to appear. We would accepts things that we shouldn't or mangle things incorrectly. Note that this hasn't fixed the other cases like
template-template parameters or non-type template parameters.
Reviewers: doug.gregor, rjmccall, rsmith
Reviewed By: rsmith
CC: cfe-commits
Differential Revision: http://llvm-reviews.chandlerc.com/D1507
llvm-svn: 189540
Diffstat (limited to 'clang/test/CodeGenCXX/mangle.cpp')
-rw-r--r-- | clang/test/CodeGenCXX/mangle.cpp | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/clang/test/CodeGenCXX/mangle.cpp b/clang/test/CodeGenCXX/mangle.cpp index a9daa0df619..f03f499fe13 100644 --- a/clang/test/CodeGenCXX/mangle.cpp +++ b/clang/test/CodeGenCXX/mangle.cpp @@ -910,3 +910,26 @@ namespace test40 { }; void g() { f(); } } + +namespace test41 { + // CHECK: define linkonce_odr void @_ZN6test414funcINS_1XEEEvNS_3fooILi20ES1_EE + template <int i, class T> struct foo { + template <class T2 = T> friend void func(foo x) {} + }; + + struct X {}; + + void g() { func(foo<20, X>()); } +} + +namespace test42 { + // CHECK: define linkonce_odr void @_ZN6test424funcINS_1XEEEvNS_3fooILi20ES1_EE + template <int i, template <class> class T> struct foo { + template <template <class> class T2 = T> friend void func(foo x) {} + }; + + template <class V> struct X { + }; + + void g() { func(foo<20, X>()); } +} |