diff options
author | Douglas Gregor <dgregor@apple.com> | 2010-08-30 14:37:53 +0000 |
---|---|---|
committer | Douglas Gregor <dgregor@apple.com> | 2010-08-30 14:37:53 +0000 |
commit | df48ddf97fb5a1310c99f3ece5255477dc1bbbdb (patch) | |
tree | dad679ee876cac54aa0825b9fb76c2c9c35e18d5 | |
parent | 7f6ff02d66bcf397cbe154da89de97fd5f96657c (diff) |
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
-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 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<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); +} |