[cfe-commits] r93015 - /cfe/trunk/test/SemaCXX/ambig-user-defined-conversions.cpp

John McCall rjmccall at apple.com
Fri Jan 8 10:40:32 PST 2010


Author: rjmccall
Date: Fri Jan  8 12:40:32 2010
New Revision: 93015

URL: http://llvm.org/viewvc/llvm-project?rev=93015&view=rev
Log:
Organize testcase into namespaces.


Modified:
    cfe/trunk/test/SemaCXX/ambig-user-defined-conversions.cpp

Modified: cfe/trunk/test/SemaCXX/ambig-user-defined-conversions.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/SemaCXX/ambig-user-defined-conversions.cpp?rev=93015&r1=93014&r2=93015&view=diff

==============================================================================
--- cfe/trunk/test/SemaCXX/ambig-user-defined-conversions.cpp (original)
+++ cfe/trunk/test/SemaCXX/ambig-user-defined-conversions.cpp Fri Jan  8 12:40:32 2010
@@ -1,52 +1,51 @@
 // RUN: %clang_cc1 -fsyntax-only -verify %s
 
-// Test1
-struct BASE { 
-  operator int &(); // expected-note {{candidate function}}
-}; 
-struct BASE1 { 
-  operator int &(); // expected-note {{candidate function}}
-}; 
-
-struct B : public BASE, BASE1 { 
-
-}; 
-
-extern B f(); 
-
-B b1;
-void func(const int ci, const char cc); // expected-note {{candidate function}}
-void func(const char ci, const B b); // expected-note {{candidate function}}
-void func(const B b, const int ci); // expected-note {{candidate function}}
-
-const int Test1() {
-  func(b1, f()); // expected-error {{call to 'func' is ambiguous}}
-  return f(); // expected-error {{conversion from 'struct B' to 'int const' is ambiguous}}
+namespace test0 {
+  struct BASE { 
+    operator int &(); // expected-note {{candidate function}}
+  }; 
+  struct BASE1 { 
+    operator int &(); // expected-note {{candidate function}}
+  }; 
+
+  struct B : public BASE, BASE1 {};
+
+  extern B f(); 
+  B b1;
+
+  void func(const int ci, const char cc); // expected-note {{candidate function}}
+  void func(const char ci, const B b); // expected-note {{candidate function}}
+  void func(const B b, const int ci); // expected-note {{candidate function}}
+
+  const int Test1() {
+    func(b1, f()); // expected-error {{call to 'func' is ambiguous}}
+    return f(); // expected-error {{conversion from 'struct test0::B' to 'int const' is ambiguous}}
+  }
 }
 
-
-// Test2
-struct E;
-struct A { 
-  A (E&); 
-};
-
-struct E { 
-  operator A (); 
-};
-
-struct C { 
-  C (E&);  
-};
-
-void f1(A);	// expected-note {{candidate function}}
-void f1(C);	// expected-note {{candidate function}}
-
-void Test2()
-{
-	E b;
-	f1(b);  // expected-error {{call to 'f1' is ambiguous}}	
-                // ambiguous because b -> C via constructor and
-                // b → A via constructor or conversion function.
+namespace test1 {
+  struct E;
+  struct A { 
+    A (E&); 
+  };
+
+  struct E { 
+    operator A (); 
+  };
+
+  struct C { 
+    C (E&);  
+  };
+
+  void f1(A);	// expected-note {{candidate function}}
+  void f1(C);	// expected-note {{candidate function}}
+
+  void Test2()
+  {
+    E b;
+    f1(b);  // expected-error {{call to 'f1' is ambiguous}}	
+            // ambiguous because b -> C via constructor and
+            // b → A via constructor or conversion function.
+  }
 }
 





More information about the cfe-commits mailing list