1*0a6a1f1dSLionel Sambuc // RUN: %clang_cc1 -fexceptions -fcxx-exceptions -verify %s -DERRORS 2*0a6a1f1dSLionel Sambuc // RUN: %clang_cc1 -fexceptions -fcxx-exceptions -emit-llvm-only %s 3f4a2713aSLionel Sambuc 4*0a6a1f1dSLionel Sambuc #ifdef ERRORS 5*0a6a1f1dSLionel Sambuc template<typename T> void f1(T*) throw(T); // expected-error{{incomplete type 'Incomplete' is not allowed in exception specification}} 6f4a2713aSLionel Sambuc struct Incomplete; // expected-note{{forward}} 7f4a2713aSLionel Sambuc test_f1(Incomplete * incomplete_p,int * int_p)8f4a2713aSLionel Sambucvoid test_f1(Incomplete *incomplete_p, int *int_p) { 9f4a2713aSLionel Sambuc f1(int_p); 10*0a6a1f1dSLionel Sambuc f1(incomplete_p); // expected-note{{instantiation of}} 11f4a2713aSLionel Sambuc } 12*0a6a1f1dSLionel Sambuc #endif 13*0a6a1f1dSLionel Sambuc f(void (* p)()throw (T))14*0a6a1f1dSLionel Sambuctemplate<typename T> void f(void (*p)() throw(T)) { 15*0a6a1f1dSLionel Sambuc #ifdef ERRORS 16*0a6a1f1dSLionel Sambuc void (*q)() throw(char) = p; // expected-error {{target exception spec}} 17*0a6a1f1dSLionel Sambuc 18*0a6a1f1dSLionel Sambuc extern void (*p2)() throw(T); 19*0a6a1f1dSLionel Sambuc void (*q2)() throw(char) = p2; // expected-error {{target exception spec}} 20*0a6a1f1dSLionel Sambuc 21*0a6a1f1dSLionel Sambuc extern void (*p3)() throw(char); 22*0a6a1f1dSLionel Sambuc void (*q3)() throw(T) = p3; // expected-error {{target exception spec}} 23*0a6a1f1dSLionel Sambuc 24*0a6a1f1dSLionel Sambuc void (*q4)() throw(T) = p2; // ok 25*0a6a1f1dSLionel Sambuc #endif 26*0a6a1f1dSLionel Sambuc p(); 27*0a6a1f1dSLionel Sambuc } g()28*0a6a1f1dSLionel Sambucvoid g() { f<int>(0); } // expected-note {{instantiation of}} 29