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 | f834bcd659ec8c74587712fe74e4251312733b69 (patch) | |
tree | 6533655dee09f4890223d723ad11e937adf85250 /clang/test/CodeGenCXX/mangle.cpp | |
parent | 7b02b583b23fac6f31e0645dc1c11340291ea4a3 (diff) | |
download | bcm5719-llvm-f834bcd659ec8c74587712fe74e4251312733b69.tar.gz bcm5719-llvm-f834bcd659ec8c74587712fe74e4251312733b69.zip |
Mangle explicit template arguments in dependent or overloaded names.
llvm-svn: 111591
Diffstat (limited to 'clang/test/CodeGenCXX/mangle.cpp')
-rw-r--r-- | clang/test/CodeGenCXX/mangle.cpp | 45 |
1 files changed, 42 insertions, 3 deletions
diff --git a/clang/test/CodeGenCXX/mangle.cpp b/clang/test/CodeGenCXX/mangle.cpp index c7a6e0096bd..55357c7d63a 100644 --- a/clang/test/CodeGenCXX/mangle.cpp +++ b/clang/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()))); +} |