From: Douglas Gregor Date: Mon, 30 Aug 2010 14:37:53 +0000 (+0000) Subject: Add test case from PR6952, which now works (thanks to Gabor). X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=df48ddf97fb5a1310c99f3ece5255477dc1bbbdb;p=clang Add test case from PR6952, which now works (thanks to Gabor). git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@112477 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/test/CXX/temp/temp.decls/temp.friend/p4.cpp b/test/CXX/temp/temp.decls/temp.friend/p4.cpp index 226ac0fc62..e036cef32b 100644 --- a/test/CXX/temp/temp.decls/temp.friend/p4.cpp +++ b/test/CXX/temp/temp.decls/temp.friend/p4.cpp @@ -8,3 +8,21 @@ struct X1 { X1 x1a; X1 x1b; // expected-note {{in instantiation of}} + +template +struct X2 { + operator int(); + + friend void f(int x) { } // expected-error{{redefinition}} \ + // expected-note{{previous definition}} +}; + +int array0[sizeof(X2)]; +int array1[sizeof(X2)]; // expected-note{{instantiation of}} + +void g() { + X2 xi; + f(xi); + X2 xf; + f(xf); +}