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 | 9d57b8dea3b139dc2e2976ffccef50c74ac03873 (patch) | |
tree | a0fbb8e814611a0fcf5f44f723e25812855b1189 /test/CodeGenCXX/mangle.cpp | |
parent | 112586cef341143febbf6b781df6491c07db0e91 (diff) |
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
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@189540 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test/CodeGenCXX/mangle.cpp')
-rw-r--r-- | test/CodeGenCXX/mangle.cpp | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/test/CodeGenCXX/mangle.cpp b/test/CodeGenCXX/mangle.cpp index a9daa0df61..f03f499fe1 100644 --- a/test/CodeGenCXX/mangle.cpp +++ b/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>()); } +} |