diff options
author | David Majnemer <david.majnemer@gmail.com> | 2013-08-16 08:29:13 +0000 |
---|---|---|
committer | David Majnemer <david.majnemer@gmail.com> | 2013-08-16 08:29:13 +0000 |
commit | 360d23ef628bf891514e77c519d1d77305ca1743 (patch) | |
tree | 0f4459d30c2d51377b8cb6bb4776eae92e1e3986 /test/CodeGenCXX/mangle-ms-templates.cpp | |
parent | c79ce4214cf4f81ae31146731ceb5d01cfcceb96 (diff) |
Parse: Do not 'HandleTopLevelDecl' on templated functions.
Summary:
HandleTopLevelDecl on a templated function leads us to try and mangle
it.
Reviewers: rsmith
Reviewed By: rsmith
CC: cfe-commits
Differential Revision: http://llvm-reviews.chandlerc.com/D1412
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@188536 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test/CodeGenCXX/mangle-ms-templates.cpp')
-rw-r--r-- | test/CodeGenCXX/mangle-ms-templates.cpp | 13 |
1 files changed, 11 insertions, 2 deletions
diff --git a/test/CodeGenCXX/mangle-ms-templates.cpp b/test/CodeGenCXX/mangle-ms-templates.cpp index 57a33740cc..713f8e9689 100644 --- a/test/CodeGenCXX/mangle-ms-templates.cpp +++ b/test/CodeGenCXX/mangle-ms-templates.cpp @@ -1,5 +1,5 @@ -// RUN: %clang_cc1 -std=c++11 -emit-llvm %s -o - -cxx-abi microsoft -fms-extensions -triple=i386-pc-win32 | FileCheck %s -// RUN: %clang_cc1 -std=c++11 -emit-llvm %s -o - -cxx-abi microsoft -fms-extensions -triple=x86_64-pc-win32 | FileCheck -check-prefix X64 %s +// RUN: %clang_cc1 -std=c++11 -emit-llvm %s -o - -cxx-abi microsoft -fms-extensions -fdelayed-template-parsing -triple=i386-pc-win32 | FileCheck %s +// RUN: %clang_cc1 -std=c++11 -emit-llvm %s -o - -cxx-abi microsoft -fms-extensions -fdelayed-template-parsing -triple=x86_64-pc-win32 | FileCheck -check-prefix X64 %s template<typename T> class Class { @@ -215,3 +215,12 @@ void fun(UUIDType1<uuid> a) {} // CHECK: "\01?fun@@YAXU?$UUIDType1@Uuuid@@$1?_GUID_12345678_1234_1234_1234_1234567890ab@@3U__s_GUID@@B@@@Z" void fun(UUIDType2<uuid> b) {} // CHECK: "\01?fun@@YAXU?$UUIDType2@Uuuid@@$E?_GUID_12345678_1234_1234_1234_1234567890ab@@3U__s_GUID@@B@@@Z" + +template <typename T> struct TypeWithFriendDefinition { + friend void FunctionDefinedWithInjectedName(TypeWithFriendDefinition<T>) {} +}; +// CHECK: call {{.*}} @"\01?FunctionDefinedWithInjectedName@@YAXU?$TypeWithFriendDefinition@H@@@Z" +void CallFunctionDefinedWithInjectedName() { + FunctionDefinedWithInjectedName(TypeWithFriendDefinition<int>()); +} +// CHECK: @"\01?FunctionDefinedWithInjectedName@@YAXU?$TypeWithFriendDefinition@H@@@Z" |