Improve the diagnostics used to report implicitly-generated class members
as parts of overload sets.  Also, refer to constructors as 'constructors'
rather than functions.

Adjust a lot of tests.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@92832 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/test/SemaCXX/condition.cpp b/test/SemaCXX/condition.cpp
index a0b57e1..7931d11 100644
--- a/test/SemaCXX/condition.cpp
+++ b/test/SemaCXX/condition.cpp
@@ -16,8 +16,8 @@
   for (;s;) ; // expected-error {{value of type 'struct S' is not contextually convertible to 'bool'}}
   switch (s) {} // expected-error {{statement requires expression of integer type ('struct S' invalid)}}
 
-  while (struct S {} x=0) ; // expected-error {{types may not be defined in conditions}} expected-error {{no viable conversion}} expected-error {{value of type 'struct S' is not contextually convertible to 'bool'}} expected-note{{candidate function}}
-  while (struct {} x=0) ; // expected-error {{types may not be defined in conditions}} expected-error {{no viable conversion}} expected-error {{value of type 'struct <anonymous>' is not contextually convertible to 'bool'}} expected-note{{candidate function}}
+  while (struct S {} x=0) ; // expected-error {{types may not be defined in conditions}} expected-error {{no viable conversion}} expected-error {{value of type 'struct S' is not contextually convertible to 'bool'}} expected-note{{candidate is the implicit copy constructor}}
+  while (struct {} x=0) ; // expected-error {{types may not be defined in conditions}} expected-error {{no viable conversion}} expected-error {{value of type 'struct <anonymous>' is not contextually convertible to 'bool'}} expected-note{{candidate is the implicit copy constructor}}
   switch (enum {E} x=0) ; // expected-error {{types may not be defined in conditions}} expected-error {{cannot initialize}}
 
   if (int x=0) { // expected-note 2 {{previous definition is here}}
diff --git a/test/SemaCXX/constructor-initializer.cpp b/test/SemaCXX/constructor-initializer.cpp
index 67d4074..ecab4e4 100644
--- a/test/SemaCXX/constructor-initializer.cpp
+++ b/test/SemaCXX/constructor-initializer.cpp
@@ -97,13 +97,10 @@
                                                   // expected-error {{member initializer 'NonExisting' does not name a non-static data member or}}
 };
 
-                        // FIXME. This is bad message!
-struct M {              // expected-note {{candidate function}} \
-                        // expected-note {{candidate function}} \
+struct M {              // expected-note 2 {{candidate is the implicit copy constructor}} \
                         // expected-note {{declared here}} \
                         // expected-note {{declared here}}
-  M(int i, int j);      // expected-note {{candidate function}} \
-                        // // expected-note {{candidate function}}
+  M(int i, int j);      // expected-note 2 {{candidate constructor}}
 };
 
 struct N : M  {
diff --git a/test/SemaCXX/conversion-function.cpp b/test/SemaCXX/conversion-function.cpp
index db322f4..4fef172 100644
--- a/test/SemaCXX/conversion-function.cpp
+++ b/test/SemaCXX/conversion-function.cpp
@@ -56,9 +56,9 @@
 
 // This used to crash Clang.
 struct Flip;
-struct Flop { // expected-note{{candidate function}}
+struct Flop { // expected-note{{candidate is the implicit copy constructor}}
   Flop();
-  Flop(const Flip&); // expected-note{{candidate function}}
+  Flop(const Flip&); // expected-note{{candidate constructor}}
 };
 struct Flip {
   operator Flop() const; // expected-note{{candidate function}}
diff --git a/test/SemaCXX/converting-constructor.cpp b/test/SemaCXX/converting-constructor.cpp
index e78798b..3ef003c 100644
--- a/test/SemaCXX/converting-constructor.cpp
+++ b/test/SemaCXX/converting-constructor.cpp
@@ -27,7 +27,7 @@
   FromShort(short s);
 };
 
-class FromShortExplicitly { // expected-note{{candidate function}}
+class FromShortExplicitly { // expected-note{{candidate is the implicit copy constructor}}
 public:
   explicit FromShortExplicitly(short s);
 };
diff --git a/test/SemaCXX/copy-initialization.cpp b/test/SemaCXX/copy-initialization.cpp
index ad14923..2cf878a 100644
--- a/test/SemaCXX/copy-initialization.cpp
+++ b/test/SemaCXX/copy-initialization.cpp
@@ -2,7 +2,7 @@
 class X {
 public:
   explicit X(const X&);
-  X(int*); // expected-note 2{{candidate function}}
+  X(int*); // expected-note 2{{candidate constructor}}
   explicit X(float*);
 };
 
diff --git a/test/SemaCXX/dcl_init_aggr.cpp b/test/SemaCXX/dcl_init_aggr.cpp
index 87b51e3..f928626 100644
--- a/test/SemaCXX/dcl_init_aggr.cpp
+++ b/test/SemaCXX/dcl_init_aggr.cpp
@@ -40,9 +40,9 @@
 struct TooFew { int a; char* b; int c; }; 
 TooFew too_few = { 1, "asdf" }; // okay
 
-struct NoDefaultConstructor { // expected-note 3 {{candidate function}} \
+struct NoDefaultConstructor { // expected-note 3 {{candidate is the implicit copy constructor}} \
                               // expected-note{{declared here}}
-  NoDefaultConstructor(int); // expected-note 3 {{candidate function}}
+  NoDefaultConstructor(int); // expected-note 3 {{candidate constructor}}
 };
 struct TooFewError { // expected-error{{implicit default constructor for}}
   int a;
@@ -115,7 +115,7 @@
 B2 b2_3 = { c2, a2, a2 };
 
 // C++ [dcl.init.aggr]p15:
-union u { int a; char* b; }; // expected-note{{candidate function}}
+union u { int a; char* b; }; // expected-note{{candidate is the implicit copy constructor}}
 u u1 = { 1 }; 
 u u2 = u1; 
 u u3 = 1; // expected-error{{no viable conversion}}
diff --git a/test/SemaCXX/decl-init-ref.cpp b/test/SemaCXX/decl-init-ref.cpp
index 294543f..656f343 100644
--- a/test/SemaCXX/decl-init-ref.cpp
+++ b/test/SemaCXX/decl-init-ref.cpp
@@ -1,6 +1,6 @@
 // RUN: %clang_cc1 -fsyntax-only -verify -std=c++0x %s
 
-struct A {}; // expected-note {{candidate function}}
+struct A {}; // expected-note {{candidate is the implicit copy constructor}}
 
 struct BASE {
   operator A(); // expected-note {{candidate function}}
diff --git a/test/SemaCXX/default2.cpp b/test/SemaCXX/default2.cpp
index 880255e..d2c44bd 100644
--- a/test/SemaCXX/default2.cpp
+++ b/test/SemaCXX/default2.cpp
@@ -82,7 +82,7 @@
 // constructors.
 class Z {
 public:
-  Z(Z&, int i = 17); // expected-note 3 {{candidate function}}
+  Z(Z&, int i = 17); // expected-note 3 {{candidate constructor}}
 
   void f(Z& z) { 
     Z z2;    // expected-error{{no matching constructor for initialization}}
@@ -103,7 +103,7 @@
 
   void f(ZZ z = g()); // expected-error{{no matching constructor for initialization}}
 
-  ZZ(ZZ&, int = 17); // expected-note{{candidate function}}
+  ZZ(ZZ&, int = 17); // expected-note{{candidate constructor}}
 };
 
 // http://www.open-std.org/jtc1/sc22/wg21/docs/cwg_active.html#325
diff --git a/test/SemaCXX/direct-initializer.cpp b/test/SemaCXX/direct-initializer.cpp
index 03a5da3..bc1cde5 100644
--- a/test/SemaCXX/direct-initializer.cpp
+++ b/test/SemaCXX/direct-initializer.cpp
@@ -13,16 +13,16 @@
   explicit Y(float);
 };
 
-class X { // expected-note{{candidate function}}
+class X { // expected-note{{candidate is the implicit copy constructor}}
 public:
-  explicit X(int); // expected-note{{candidate function}}
-  X(float, float, float); // expected-note{{candidate function}}
-  X(float, Y); // expected-note{{candidate function}}
+  explicit X(int); // expected-note{{candidate constructor}}
+  X(float, float, float); // expected-note{{candidate constructor}}
+  X(float, Y); // expected-note{{candidate constructor}}
 };
 
-class Z { // expected-note{{candidate function}}
+class Z { // expected-note{{candidate is the implicit copy constructor}}
 public:
-  Z(int); // expected-note{{candidate function}}
+  Z(int); // expected-note{{candidate constructor}}
 };
 
 void g() {
diff --git a/test/SemaCXX/functional-cast.cpp b/test/SemaCXX/functional-cast.cpp
index 63be770..946d471 100644
--- a/test/SemaCXX/functional-cast.cpp
+++ b/test/SemaCXX/functional-cast.cpp
@@ -10,10 +10,8 @@
   InitViaConstructor(int i = 7);
 };
 
-// FIXME: error messages for implicitly-declared special member
-// function candidates are very poor
-struct NoValueInit { // expected-note 2 {{candidate function}} 
-  NoValueInit(int i, int j); // expected-note 2 {{candidate function}}
+struct NoValueInit { // expected-note 2 {{candidate is the implicit copy constructor}} 
+  NoValueInit(int i, int j); // expected-note 2 {{candidate constructor}}
 };
 
 void test_cxx_functional_value_init() {
diff --git a/test/SemaCXX/namespace.cpp b/test/SemaCXX/namespace.cpp
index ab690b7..38b31f7 100644
--- a/test/SemaCXX/namespace.cpp
+++ b/test/SemaCXX/namespace.cpp
@@ -9,7 +9,7 @@
 class A; // expected-error {{redefinition of 'A' as different kind of symbol}}
 
 class B {}; // expected-note {{previous definition is here}} \
-            // FIXME: ugly expected-note{{candidate function}}
+            // expected-note{{candidate is the implicit copy assignment operator}}
 
 void C(); // expected-note {{previous definition is here}}
 namespace C {} // expected-error {{redefinition of 'C' as different kind of symbol}}
diff --git a/test/SemaCXX/nested-name-spec.cpp b/test/SemaCXX/nested-name-spec.cpp
index 4e65b41..a53231d 100644
--- a/test/SemaCXX/nested-name-spec.cpp
+++ b/test/SemaCXX/nested-name-spec.cpp
@@ -178,7 +178,7 @@
 
 
 namespace somens {
-  struct a { }; // expected-note{{candidate function}}
+  struct a { }; // expected-note{{candidate is the implicit copy constructor}}
 }
 
 template <typename T>
diff --git a/test/SemaCXX/overloaded-builtin-operators.cpp b/test/SemaCXX/overloaded-builtin-operators.cpp
index 12903cc..e9ffc2a 100644
--- a/test/SemaCXX/overloaded-builtin-operators.cpp
+++ b/test/SemaCXX/overloaded-builtin-operators.cpp
@@ -59,7 +59,7 @@
   // FIXME: should pass (void)static_cast<no&>(islong(e1 % e2));
 }
 
-struct ShortRef { // expected-note{{candidate function}}
+struct ShortRef { // expected-note{{candidate is the implicit copy assignment operator}}
   operator short&();
 };
 
@@ -67,7 +67,7 @@
   operator volatile long&();
 };
 
-struct XpmfRef { // expected-note{{candidate function}}
+struct XpmfRef { // expected-note{{candidate is the implicit copy assignment operator}}
   operator pmf&();
 };
 
diff --git a/test/SemaCXX/rval-references.cpp b/test/SemaCXX/rval-references.cpp
index 7ff3d58..1cde263 100644
--- a/test/SemaCXX/rval-references.cpp
+++ b/test/SemaCXX/rval-references.cpp
@@ -67,8 +67,8 @@
   MoveOnly();
   MoveOnly(const MoveOnly&) = delete;	// expected-note {{candidate function}} \
   // expected-note 3{{explicitly marked deleted here}}
-  MoveOnly(MoveOnly&&);	// expected-note {{candidate function}}
-  MoveOnly(int&&);	// expected-note {{candidate function}}
+  MoveOnly(MoveOnly&&);	// expected-note {{candidate constructor}}
+  MoveOnly(int&&);	// expected-note {{candidate constructor}}
 };
 
 MoveOnly gmo;