summaryrefslogtreecommitdiffstats
path: root/test/CodeGenCXX/mangle.cpp
diff options
context:
space:
mode:
authorJohn McCall <rjmccall@apple.com>2011-07-01 02:19:08 +0000
committerJohn McCall <rjmccall@apple.com>2011-07-01 02:19:08 +0000
commit35ee32e800145a535f2676898f8f06f7ae6e9b43 (patch)
treee312343bd4ccc17aa83366e8f86f2df3c2aa049e /test/CodeGenCXX/mangle.cpp
parent561f81243f665cf2001caadc45df505f826b72d6 (diff)
Just mangle substituted template parameter types as unresolved types.
This is kindof questionable but seems to do more-or-less the right thing. This is not a particularly friendly part of the ABI. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@134227 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test/CodeGenCXX/mangle.cpp')
-rw-r--r--test/CodeGenCXX/mangle.cpp32
1 files changed, 32 insertions, 0 deletions
diff --git a/test/CodeGenCXX/mangle.cpp b/test/CodeGenCXX/mangle.cpp
index 8363528570..dd10ca4a21 100644
--- a/test/CodeGenCXX/mangle.cpp
+++ b/test/CodeGenCXX/mangle.cpp
@@ -770,3 +770,35 @@ namespace test31 { // instantiation-dependent mangling of decltype
// CHECK: define weak_odr void @_ZN6test312f3IiEEDTcl1gfp_EET_
template void f3(int);
}
+
+// PR10205
+namespace test32 {
+ template<typename T, int=T::value> struct A {
+ typedef int type;
+ };
+ struct B { enum { value = 4 }; };
+
+ template <class T> typename A<T>::type foo() { return 0; }
+ void test() {
+ foo<B>();
+ // CHECK: call i32 @_ZN6test323fooINS_1BEEENS_1AIT_XsrS3_5valueEE4typeEv()
+ }
+}
+
+namespace test33 {
+ template <class T> struct X {
+ enum { value = T::value };
+ };
+
+ template<typename T, int=X<T>::value> struct A {
+ typedef int type;
+ };
+ struct B { enum { value = 4 }; };
+
+ template <class T> typename A<T>::type foo() { return 0; }
+
+ void test() {
+ foo<B>();
+ // CHECK: call i32 @_ZN6test333fooINS_1BEEENS_1AIT_Xsr1XIS3_EE5valueEE4typeEv()
+ }
+}