p4.cpp revision 1afa611e36e0ab23dd3cde4bbe5aa74ceb7d77c5
1// RUN: %clang_cc1 -fsyntax-only -verify %s 2 3template<typename T> 4struct X1 { 5 friend void f6(int) { } // expected-error{{redefinition of}} \ 6 // expected-note{{previous definition}} 7}; 8 9X1<int> x1a; 10X1<float> x1b; // expected-note {{in instantiation of}} 11 12template<typename T> 13struct X2 { 14 operator int(); 15 16 friend void f(int x) { } // expected-error{{redefinition}} \ 17 // expected-note{{previous definition}} 18}; 19 20int array0[sizeof(X2<int>)]; 21int array1[sizeof(X2<float>)]; // expected-note{{instantiation of}} 22 23void g() { 24 X2<int> xi; 25 f(xi); 26 X2<float> xf; 27 f(xf); 28} 29