From 06d4ba388873e6d1cfa9cd715a8935ecc8cd2097 Mon Sep 17 00:00:00 2001 From: Dimitry Andric Date: Sun, 18 Jan 2015 16:23:48 +0000 Subject: Vendor import of clang RELEASE_360/rc1 tag r226102 (effectively, 3.6.0 RC1): https://llvm.org/svn/llvm-project/cfe/tags/RELEASE_360/rc1@226102 --- test/CodeGenCXX/explicit-instantiation.cpp | 13 +++++++++++++ 1 file changed, 13 insertions(+) (limited to 'test/CodeGenCXX/explicit-instantiation.cpp') diff --git a/test/CodeGenCXX/explicit-instantiation.cpp b/test/CodeGenCXX/explicit-instantiation.cpp index 5bd06784cfab..6076444c25b0 100644 --- a/test/CodeGenCXX/explicit-instantiation.cpp +++ b/test/CodeGenCXX/explicit-instantiation.cpp @@ -90,6 +90,19 @@ namespace LateInstantiation { // CHECK-OPT: define available_externally i32 @_ZN17LateInstantiation1fIiEEiv( } +namespace PR21718 { +// The linkage of a used constexpr member function can change from linkonce_odr +// to weak_odr after explicit instantiation without errors about defining the +// same function twice. +template +struct S { +// CHECK-LABEL: define weak_odr i32 @_ZN7PR217181SIiE1fEv + __attribute__((used)) constexpr int f() { return 0; } +}; +int g() { return S().f(); } +template struct S; +} + // Check that we emit definitions from explicit instantiations even when they // occur prior to the definition itself. template struct S { -- cgit v1.3