diff options
Diffstat (limited to 'test/CXX/temp/temp.decls/temp.friend/p4.cpp')
-rw-r--r-- | test/CXX/temp/temp.decls/temp.friend/p4.cpp | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/test/CXX/temp/temp.decls/temp.friend/p4.cpp b/test/CXX/temp/temp.decls/temp.friend/p4.cpp index 226ac0fc622f..e036cef32b28 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<int> x1a; X1<float> x1b; // expected-note {{in instantiation of}} + +template<typename T> +struct X2 { + operator int(); + + friend void f(int x) { } // expected-error{{redefinition}} \ + // expected-note{{previous definition}} +}; + +int array0[sizeof(X2<int>)]; +int array1[sizeof(X2<float>)]; // expected-note{{instantiation of}} + +void g() { + X2<int> xi; + f(xi); + X2<float> xf; + f(xf); +} |