]> granicus.if.org Git - clang/commitdiff
Add test case from PR6952, which now works (thanks to Gabor).
authorDouglas Gregor <dgregor@apple.com>
Mon, 30 Aug 2010 14:37:53 +0000 (14:37 +0000)
committerDouglas Gregor <dgregor@apple.com>
Mon, 30 Aug 2010 14:37:53 +0000 (14:37 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@112477 91177308-0d34-0410-b5e6-96231b3b80d8

test/CXX/temp/temp.decls/temp.friend/p4.cpp

index 226ac0fc622f3fc5609090de1aa47e91b312973b..e036cef32b283e5a712ea3d374ecf9148077f2a2 100644 (file)
@@ -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);
+}