diff options
author | John McCall <rjmccall@apple.com> | 2011-05-04 01:45:19 +0000 |
---|---|---|
committer | John McCall <rjmccall@apple.com> | 2011-05-04 01:45:19 +0000 |
commit | 4f4e413f282609d4a488b44fc8669c28636a7aba (patch) | |
tree | cbd28d55f1ba244ba8a01c34ee13ebf39afa3d3e /test/CodeGenCXX/mangle.cpp | |
parent | 5e1db6a434d0e3fe0fbde0bca2ec44552818fb22 (diff) |
Type prefixes of unresolved-names should only be mangled as unresolved-types
if they match that production, i.e. if they're template type parameters
or decltypes (or, as an obvious case not yet described in the ABI document,
if they're template template parameters applied to template arguments).
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@130824 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test/CodeGenCXX/mangle.cpp')
-rw-r--r-- | test/CodeGenCXX/mangle.cpp | 43 |
1 files changed, 39 insertions, 4 deletions
diff --git a/test/CodeGenCXX/mangle.cpp b/test/CodeGenCXX/mangle.cpp index 27777a51c4..01dcf8b230 100644 --- a/test/CodeGenCXX/mangle.cpp +++ b/test/CodeGenCXX/mangle.cpp @@ -397,16 +397,16 @@ namespace test3 { struct Path2 : AmbiguousBase { double p; }; struct Derived : Path1, Path2 { }; - // CHECK: define linkonce_odr i32 @_ZN5test38get_ab_1INS_7DerivedEEEDtptcvPT_Li0EsrNS_5Path1E2abERS2_( + // CHECK: define linkonce_odr i32 @_ZN5test38get_ab_1INS_7DerivedEEEDtptcvPT_Li0Esr5Path1E2abERS2_( template <class T> decltype(((T*) 0)->Path1::ab) get_ab_1(T &ref) { return ref.Path1::ab; } - // CHECK: define linkonce_odr i32 @_ZN5test38get_ab_2INS_7DerivedEEEDtptcvPT_Li0EsrNS_5Path2E2abERS2_( + // CHECK: define linkonce_odr i32 @_ZN5test38get_ab_2INS_7DerivedEEEDtptcvPT_Li0Esr5Path2E2abERS2_( template <class T> decltype(((T*) 0)->Path2::ab) get_ab_2(T &ref) { return ref.Path2::ab; } - // CHECK: define linkonce_odr float @_ZN5test37get_p_1INS_7DerivedEEEDtptcvPT_Li0EsrNS_5Path1E1pERS2_( + // CHECK: define linkonce_odr float @_ZN5test37get_p_1INS_7DerivedEEEDtptcvPT_Li0Esr5Path1E1pERS2_( template <class T> decltype(((T*) 0)->Path1::p) get_p_1(T &ref) { return ref.Path1::p; } - // CHECK: define linkonce_odr double @_ZN5test37get_p_2INS_7DerivedEEEDtptcvPT_Li0EsrNS_5Path2E1pERS2_( + // CHECK: define linkonce_odr double @_ZN5test37get_p_2INS_7DerivedEEEDtptcvPT_Li0Esr5Path2E1pERS2_( template <class T> decltype(((T*) 0)->Path2::p) get_p_2(T &ref) { return ref.Path2::p; } Derived obj; @@ -676,3 +676,38 @@ namespace test25 { A<foo>::call(); } } + +namespace test26 { + template <template <class> class T> void foo(decltype(T<float>::object) &object) {} + + template <class T> struct holder { static T object; }; + + void test() { + float f; + + // CHECK: call void @_ZN6test263fooINS_6holderEEEvRDtsrT_IfE6objectE( + foo<holder>(f); + } +} + +namespace test27 { + struct A { + struct inner { + float object; + }; + + float meth(); + }; + typedef A Alias; + + template <class T> void a(decltype(T::inner::object) &object) {} + template <class T> void b(decltype(T().Alias::meth()) &object) {} + + void test() { + float f; + // CHECK: call void @_ZN6test271aINS_1AEEEvRDtsrNT_5innerE6objectE( + a<A>(f); + // CHECK: call void @_ZN6test271bINS_1AEEEvRDTcldtcvT__Esr5AliasE4methEE( + b<A>(f); + } +} |