// RUN: not %clang_cc1 -std=c++11 -emit-llvm %s -o - -verify -fexceptions -fcxx-exceptions -triple x86_64-linux-gnu | FileCheck %s void h(); template void f() noexcept(sizeof(T) == 4) { h(); } template void g() noexcept(sizeof(T) == 4); template struct S { static void f() noexcept(sizeof(T) == 4) { h(); } static void g() noexcept(sizeof(T) == 4); }; // CHECK: define {{.*}} @_Z1fIsEvv() [[NONE:#[0-9]+]] { template<> void f() { h(); } // CHECK: define {{.*}} @_Z1fIA2_sEvv() [[NUW:#[0-9]+]] { template<> void f() noexcept { h(); } // CHECK: define {{.*}} @_ZN1SIsE1fEv() // CHECK-NOT: [[NUW]] template<> void S::f() { h(); } // CHECK: define {{.*}} @_ZN1SIA2_sE1fEv() [[NUW]] template<> void S::f() noexcept { h(); } // CHECK: define {{.*}} @_Z1fIDsEvv() [[NONE]] { template void f(); // CHECK: define {{.*}} @_Z1fIA2_DsEvv() [[NUW]] { template void f(); // CHECK: define {{.*}} @_ZN1SIDsE1fEv() // CHECK-NOT: [[NUW]] template void S::f(); // CHECK: define {{.*}} @_ZN1SIA2_DsE1fEv() [[NUW]] template void S::f(); void h() { // CHECK: define {{.*}} @_Z1fIiEvv() [[NUW]] { f(); // CHECK: define {{.*}} @_Z1fIA2_iEvv() [[NONE]] { f(); // CHECK: define {{.*}} @_ZN1SIiE1fEv() [[NUW]] S::f(); // CHECK: define {{.*}} @_ZN1SIA2_iE1fEv() // CHECK-NOT: [[NUW]] S::f(); // CHECK: define {{.*}} @_Z1fIfEvv() [[NUW]] { void (*f1)() = &f; // CHECK: define {{.*}} @_Z1fIdEvv() [[NONE]] { void (*f2)() = &f; // CHECK: define {{.*}} @_ZN1SIfE1fEv() [[NUW]] void (*f3)() = &S::f; // CHECK: define {{.*}} @_ZN1SIdE1fEv() // CHECK-NOT: [[NUW]] void (*f4)() = &S::f; // CHECK: define {{.*}} @_Z1fIA4_cEvv() [[NUW]] { (void)&f; // CHECK: define {{.*}} @_Z1fIcEvv() [[NONE]] { (void)&f; // CHECK: define {{.*}} @_ZN1SIA4_cE1fEv() [[NUW]] (void)&S::f; // CHECK: define {{.*}} @_ZN1SIcE1fEv() // CHECK-NOT: [[NUW]] (void)&S::f; } // CHECK: define {{.*}} @_Z1iv void i() { // CHECK: declare {{.*}} @_Z1gIiEvv() [[NUW]] g(); // CHECK: declare {{.*}} @_Z1gIA2_iEvv() // CHECK-NOT: [[NUW]] g(); // CHECK: declare {{.*}} @_ZN1SIiE1gEv() [[NUW]] S::g(); // CHECK: declare {{.*}} @_ZN1SIA2_iE1gEv() // CHECK-NOT: [[NUW]] S::g(); // CHECK: declare {{.*}} @_Z1gIfEvv() [[NUW]] void (*g1)() = &g; // CHECK: declare {{.*}} @_Z1gIdEvv() // CHECK-NOT: [[NUW]] void (*g2)() = &g; // CHECK: declare {{.*}} @_ZN1SIfE1gEv() [[NUW]] void (*g3)() = &S::g; // CHECK: declare {{.*}} @_ZN1SIdE1gEv() // CHECK-NOT: [[NUW]] void (*g4)() = &S::g; // CHECK: declare {{.*}} @_Z1gIA4_cEvv() [[NUW]] (void)&g; // CHECK: declare {{.*}} @_Z1gIcEvv() // CHECK-NOT: [[NUW]] (void)&g; // CHECK: declare {{.*}} @_ZN1SIA4_cE1gEv() [[NUW]] (void)&S::g; // CHECK: declare {{.*}} @_ZN1SIcE1gEv() // CHECK-NOT: [[NUW]] (void)&S::g; } template struct Nested { template void f() noexcept(sizeof(T) == sizeof(U)); }; // CHECK: define {{.*}} @_Z1jv void j() { // CHECK: declare {{.*}} @_ZN6NestedIiE1fILb1EcEEvv( // CHECK-NOT: [[NUW]] Nested().f(); // CHECK: declare {{.*}} @_ZN6NestedIlE1fILb0ElEEvv({{.*}}) [[NUW]] Nested().f(); } // CHECK: attributes [[NONE]] = { {{.*}} } // CHECK: attributes [[NUW]] = { nounwind{{.*}} }