diff options
author | John McCall <rjmccall@apple.com> | 2010-08-20 00:17:19 +0000 |
---|---|---|
committer | John McCall <rjmccall@apple.com> | 2010-08-20 00:17:19 +0000 |
commit | 6dbce19fdae4cfae4eb5f826284978e723a04e61 (patch) | |
tree | 9f47b793d3581813fe8c5c6494b08f4a0bd42ac8 /test/CodeGenCXX/mangle.cpp | |
parent | f128fed9c2ae16d3d6d8b8580b7a257e5c0a7754 (diff) |
Mangle explicit template arguments in dependent or overloaded names.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@111591 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test/CodeGenCXX/mangle.cpp')
-rw-r--r-- | test/CodeGenCXX/mangle.cpp | 45 |
1 files changed, 42 insertions, 3 deletions
diff --git a/test/CodeGenCXX/mangle.cpp b/test/CodeGenCXX/mangle.cpp index c7a6e0096b..55357c7d63 100644 --- a/test/CodeGenCXX/mangle.cpp +++ b/test/CodeGenCXX/mangle.cpp @@ -551,10 +551,10 @@ namespace test17 { template <class T> A<sizeof(T::foo())> func(void); - // CHECK: define i32 @_ZN6test174testEv() + // CHECK: define void @_ZN6test174testEv() // CHECK: call {{.*}} @_ZN6test174funcINS_1BEEENS_1AIXszclsrT_3fooEEEEv() - int test() { - func<B>(); // { dg-error "sorry, unimplemented" } + void test() { + func<B>(); } } @@ -585,3 +585,42 @@ namespace test18 { // CHECK: define weak_odr void @_ZN6test181fINS_1AEEEvNS_1SIXadsrT_mlEEE // CHECK: define weak_odr void @_ZN6test181fINS_1AEEEvNS_1SIXadsrT_anEEE } + +// rdar://problem/8332117 +namespace test19 { + struct A { + template <typename T> int f(); + int operator+(); + operator int(); + template <typename T> int operator-(); + }; + + template <int (A::*)()> struct S {}; + + template <typename T> void g (S<&T::template f<int> >) {} + template <typename T> void g (S<&T::operator+ >) {} + template <typename T> void g (S<&T::operator int>) {} + template <typename T> void g (S<&T::template operator- <double> >) {} + + // CHECK: define weak_odr void @_ZN6test191gINS_1AEEEvNS_1SIXadsrT_1fIiEEEE( + template void g<A>(S<&A::f<int> >); + // CHECK: define weak_odr void @_ZN6test191gINS_1AEEEvNS_1SIXadsrT_plEEE( + template void g<A>(S<&A::operator+>); + // CHECK: define weak_odr void @_ZN6test191gINS_1AEEEvNS_1SIXadsrT_cviEEE( + template void g<A>(S<&A::operator int>); + // CHECK: define weak_odr void @_ZN6test191gINS_1AEEEvNS_1SIXadsrT_miIdEEEE( + template void g<A>(S<&A::operator-<double> >); +} + +namespace test20 { + template <class T> T *f(const T&); + template <class T> T *f(T*); + + // CHECK: define weak_odr void @_ZN6test205test0IiEEvDTcl1fIPT_ELi0EEE( + template <class T> void test0(decltype(f<T*>(0))) {} + template void test0<int>(decltype(f<int*>(0))); + + // CHECK: define weak_odr void @_ZN6test205test1IiEEvDTcl1fIEcvT__EEE( + template <class T> void test1(decltype(f<>(T()))) {} + template void test1<int>(decltype(f<>(int()))); +} |