[cfe-commits] r92832 - in /cfe/trunk: include/clang/Basic/ lib/Sema/ test/CXX/dcl.decl/dcl.init/dcl.init.ref/ test/CXX/temp/temp.decls/temp.class/temp.static/ test/CXX/temp/temp.param/ test/CXX/temp/temp.spec/temp.expl.spec/ test/CXX/temp/temp.spec/temp.explicit/ test/SemaCXX/ test/SemaTemplate/
John McCall
rjmccall at apple.com
Wed Jan 6 01:43:15 PST 2010
Author: rjmccall
Date: Wed Jan 6 03:43:14 2010
New Revision: 92832
URL: http://llvm.org/viewvc/llvm-project?rev=92832&view=rev
Log:
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.
Modified:
cfe/trunk/include/clang/Basic/DiagnosticSemaKinds.td
cfe/trunk/lib/Sema/Sema.h
cfe/trunk/lib/Sema/SemaDeclCXX.cpp
cfe/trunk/lib/Sema/SemaExprCXX.cpp
cfe/trunk/lib/Sema/SemaOverload.cpp
cfe/trunk/test/CXX/dcl.decl/dcl.init/dcl.init.ref/p5-var.cpp
cfe/trunk/test/CXX/temp/temp.decls/temp.class/temp.static/p1-inst.cpp
cfe/trunk/test/CXX/temp/temp.decls/temp.class/temp.static/p1.cpp
cfe/trunk/test/CXX/temp/temp.param/p3.cpp
cfe/trunk/test/CXX/temp/temp.spec/temp.expl.spec/p15.cpp
cfe/trunk/test/CXX/temp/temp.spec/temp.expl.spec/p4.cpp
cfe/trunk/test/CXX/temp/temp.spec/temp.explicit/p1.cpp
cfe/trunk/test/SemaCXX/condition.cpp
cfe/trunk/test/SemaCXX/constructor-initializer.cpp
cfe/trunk/test/SemaCXX/conversion-function.cpp
cfe/trunk/test/SemaCXX/converting-constructor.cpp
cfe/trunk/test/SemaCXX/copy-initialization.cpp
cfe/trunk/test/SemaCXX/dcl_init_aggr.cpp
cfe/trunk/test/SemaCXX/decl-init-ref.cpp
cfe/trunk/test/SemaCXX/default2.cpp
cfe/trunk/test/SemaCXX/direct-initializer.cpp
cfe/trunk/test/SemaCXX/functional-cast.cpp
cfe/trunk/test/SemaCXX/namespace.cpp
cfe/trunk/test/SemaCXX/nested-name-spec.cpp
cfe/trunk/test/SemaCXX/overloaded-builtin-operators.cpp
cfe/trunk/test/SemaCXX/rval-references.cpp
cfe/trunk/test/SemaTemplate/constructor-template.cpp
cfe/trunk/test/SemaTemplate/default-expr-arguments.cpp
cfe/trunk/test/SemaTemplate/explicit-instantiation.cpp
cfe/trunk/test/SemaTemplate/fun-template-def.cpp
cfe/trunk/test/SemaTemplate/instantiate-expr-4.cpp
cfe/trunk/test/SemaTemplate/instantiate-static-var.cpp
Modified: cfe/trunk/include/clang/Basic/DiagnosticSemaKinds.td
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/include/clang/Basic/DiagnosticSemaKinds.td?rev=92832&r1=92831&r2=92832&view=diff
==============================================================================
--- cfe/trunk/include/clang/Basic/DiagnosticSemaKinds.td (original)
+++ cfe/trunk/include/clang/Basic/DiagnosticSemaKinds.td Wed Jan 6 03:43:14 2010
@@ -895,18 +895,26 @@
"call to member function %0 is ambiguous">;
def err_ovl_deleted_member_call : Error<
"call to %select{unavailable|deleted}0 member function %1">;
-def err_ovl_candidate : Note<"candidate function">;
-def err_ovl_candidate_not_viable : Note<"function not viable because"
- " of ambiguity in conversion of argument %0">;
+def note_ovl_candidate : Note<"candidate function">;
+def note_ovl_candidate_not_viable : Note<"function not viable because"
+ " of ambiguity in conversion of argument %0">;
+def note_ovl_candidate_ctor : Note<"candidate constructor">;
+def note_ovl_candidate_implicit_copy_ctor : Note<
+ "candidate is the implicit copy constructor">;
+def note_ovl_candidate_implicit_default_ctor : Note<
+ "candidate is the implicit default constructor">;
+def note_ovl_candidate_meth : Note<"candidate function">;
+def note_ovl_candidate_implicit_copy_assign : Note<
+ "candidate is the implicit copy assignment operator">;
def note_ambiguous_type_conversion: Note<
"because of ambiguity in conversion of %0 to %1">;
-def err_ovl_template_candidate : Note<
+def note_ovl_template_candidate : Note<
"candidate function template specialization %0">;
-def err_ovl_candidate_deleted : Note<
+def note_ovl_candidate_deleted : Note<
"candidate function has been explicitly %select{made unavailable|deleted}0">;
-def err_ovl_builtin_binary_candidate : Note<
+def note_ovl_builtin_binary_candidate : Note<
"built-in candidate %0">;
-def err_ovl_builtin_unary_candidate : Note<
+def note_ovl_builtin_unary_candidate : Note<
"built-in candidate %0">;
def err_ovl_no_viable_function_in_init : Error<
"no matching constructor for initialization of %0">;
@@ -927,7 +935,7 @@
"call to object of type %0 is ambiguous">;
def err_ovl_deleted_object_call : Error<
"call to %select{unavailable|deleted}0 function call operator in type %1">;
-def err_ovl_surrogate_cand : Note<"conversion candidate of type %0">;
+def note_ovl_surrogate_cand : Note<"conversion candidate of type %0">;
def err_member_call_without_object : Error<
"call to non-static member function without an object argument">;
Modified: cfe/trunk/lib/Sema/Sema.h
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Sema/Sema.h?rev=92832&r1=92831&r2=92832&view=diff
==============================================================================
--- cfe/trunk/lib/Sema/Sema.h (original)
+++ cfe/trunk/lib/Sema/Sema.h Wed Jan 6 03:43:14 2010
@@ -1032,6 +1032,7 @@
bool OnlyViable,
const char *Opc=0,
SourceLocation Loc=SourceLocation());
+ void NoteOverloadCandidate(FunctionDecl *Fn);
FunctionDecl *ResolveAddressOfOverloadedFunction(Expr *From, QualType ToType,
bool Complain);
Modified: cfe/trunk/lib/Sema/SemaDeclCXX.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Sema/SemaDeclCXX.cpp?rev=92832&r1=92831&r2=92832&view=diff
==============================================================================
--- cfe/trunk/lib/Sema/SemaDeclCXX.cpp (original)
+++ cfe/trunk/lib/Sema/SemaDeclCXX.cpp Wed Jan 6 03:43:14 2010
@@ -4695,7 +4695,7 @@
for (int j = Conversions.ConversionFunctionSet.size()-1;
j >= 0; j--) {
FunctionDecl *Func = Conversions.ConversionFunctionSet[j];
- Diag(Func->getLocation(), diag::err_ovl_candidate);
+ NoteOverloadCandidate(Func);
}
}
else {
Modified: cfe/trunk/lib/Sema/SemaExprCXX.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Sema/SemaExprCXX.cpp?rev=92832&r1=92831&r2=92832&view=diff
==============================================================================
--- cfe/trunk/lib/Sema/SemaExprCXX.cpp (original)
+++ cfe/trunk/lib/Sema/SemaExprCXX.cpp Wed Jan 6 03:43:14 2010
@@ -921,7 +921,7 @@
<< Type << Ex->getSourceRange();
for (unsigned i= 0; i < ObjectPtrConversions.size(); i++) {
CXXConversionDecl *Conv = ObjectPtrConversions[i];
- Diag(Conv->getLocation(), diag::err_ovl_candidate);
+ NoteOverloadCandidate(Conv);
}
return ExprError();
}
Modified: cfe/trunk/lib/Sema/SemaOverload.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Sema/SemaOverload.cpp?rev=92832&r1=92831&r2=92832&view=diff
==============================================================================
--- cfe/trunk/lib/Sema/SemaOverload.cpp (original)
+++ cfe/trunk/lib/Sema/SemaOverload.cpp Wed Jan 6 03:43:14 2010
@@ -4274,6 +4274,44 @@
return OR_Success;
}
+/// Notes the location of an overload candidate.
+void Sema::NoteOverloadCandidate(FunctionDecl *Fn) {
+
+ if (CXXConstructorDecl *Ctor = dyn_cast<CXXConstructorDecl>(Fn)) {
+ // At least call it a 'constructor'.
+ if (!Ctor->isImplicit()) {
+ Diag(Ctor->getLocation(), diag::note_ovl_candidate_ctor);
+ return;
+ }
+
+ CXXRecordDecl *Record = Ctor->getParent();
+ if (Ctor->isCopyConstructor()) {
+ Diag(Record->getLocation(), diag::note_ovl_candidate_implicit_copy_ctor);
+ return;
+ }
+
+ Diag(Record->getLocation(), diag::note_ovl_candidate_implicit_default_ctor);
+ return;
+ }
+
+ if (CXXMethodDecl *Meth = dyn_cast<CXXMethodDecl>(Fn)) {
+ // This actually gets spelled 'candidate function' for now, but
+ // it doesn't hurt to split it out.
+ if (!Meth->isImplicit()) {
+ Diag(Meth->getLocation(), diag::note_ovl_candidate_meth);
+ return;
+ }
+
+ assert(Meth->isCopyAssignment()
+ && "implicit method is not copy assignment operator?");
+ Diag(Meth->getParent()->getLocation(),
+ diag::note_ovl_candidate_implicit_copy_assign);
+ return;
+ }
+
+ Diag(Fn->getLocation(), diag::note_ovl_candidate);
+}
+
/// PrintOverloadCandidates - When overload resolution fails, prints
/// diagnostic messages containing the candidates in the candidate
/// set. If OnlyViable is true, only viable candidates will be printed.
@@ -4291,13 +4329,13 @@
if (Cand->Function->isDeleted() ||
Cand->Function->getAttr<UnavailableAttr>()) {
// Deleted or "unavailable" function.
- Diag(Cand->Function->getLocation(), diag::err_ovl_candidate_deleted)
+ Diag(Cand->Function->getLocation(), diag::note_ovl_candidate_deleted)
<< Cand->Function->isDeleted();
} else if (FunctionTemplateDecl *FunTmpl
= Cand->Function->getPrimaryTemplate()) {
// Function template specialization
// FIXME: Give a better reason!
- Diag(Cand->Function->getLocation(), diag::err_ovl_template_candidate)
+ Diag(Cand->Function->getLocation(), diag::note_ovl_template_candidate)
<< getTemplateArgumentBindingsText(FunTmpl->getTemplateParameters(),
*Cand->Function->getTemplateSpecializationArgs());
} else {
@@ -4312,17 +4350,17 @@
Conversion.ConversionFunctionSet.size() == 0)
continue;
Diag(Cand->Function->getLocation(),
- diag::err_ovl_candidate_not_viable) << (i+1);
+ diag::note_ovl_candidate_not_viable) << (i+1);
errReported = true;
for (int j = Conversion.ConversionFunctionSet.size()-1;
j >= 0; j--) {
FunctionDecl *Func = Conversion.ConversionFunctionSet[j];
- Diag(Func->getLocation(), diag::err_ovl_candidate);
+ NoteOverloadCandidate(Func);
}
}
}
if (!errReported)
- Diag(Cand->Function->getLocation(), diag::err_ovl_candidate);
+ NoteOverloadCandidate(Cand->Function);
}
} else if (Cand->IsSurrogate) {
// Desugar the type of the surrogate down to a function type,
@@ -4352,7 +4390,7 @@
if (isRValueReference) FnType = Context.getRValueReferenceType(FnType);
if (isLValueReference) FnType = Context.getLValueReferenceType(FnType);
- Diag(Cand->Surrogate->getLocation(), diag::err_ovl_surrogate_cand)
+ Diag(Cand->Surrogate->getLocation(), diag::note_ovl_surrogate_cand)
<< FnType;
} else if (OnlyViable) {
assert(Cand->Conversions.size() <= 2 &&
@@ -4363,13 +4401,13 @@
TypeStr += Cand->BuiltinTypes.ParamTypes[0].getAsString();
if (Cand->Conversions.size() == 1) {
TypeStr += ")";
- Diag(OpLoc, diag::err_ovl_builtin_unary_candidate) << TypeStr;
+ Diag(OpLoc, diag::note_ovl_builtin_unary_candidate) << TypeStr;
}
else {
TypeStr += ", ";
TypeStr += Cand->BuiltinTypes.ParamTypes[1].getAsString();
TypeStr += ")";
- Diag(OpLoc, diag::err_ovl_builtin_binary_candidate) << TypeStr;
+ Diag(OpLoc, diag::note_ovl_builtin_binary_candidate) << TypeStr;
}
}
else if (!Cand->Viable && !Reported) {
@@ -4393,7 +4431,7 @@
for (unsigned j = 0; j < ICS.ConversionFunctionSet.size(); j++) {
FunctionDecl *Func =
Cand->Conversions[ArgIdx].ConversionFunctionSet[j];
- Diag(Func->getLocation(),diag::err_ovl_candidate);
+ NoteOverloadCandidate(Func);
}
}
Reported = true;
@@ -4586,7 +4624,7 @@
PDiag(),
PDiag(diag::err_addr_ovl_ambiguous)
<< TemplateMatches[0]->getDeclName(),
- PDiag(diag::err_ovl_template_candidate));
+ PDiag(diag::note_ovl_template_candidate));
MarkDeclarationReferenced(From->getLocStart(), Result);
return Result;
}
@@ -4611,7 +4649,7 @@
Diag(From->getLocStart(), diag::err_addr_ovl_ambiguous)
<< RemainingMatches[0]->getDeclName();
for (unsigned I = 0, N = RemainingMatches.size(); I != N; ++I)
- Diag(RemainingMatches[I]->getLocation(), diag::err_ovl_candidate);
+ NoteOverloadCandidate(RemainingMatches[I]);
return 0;
}
Modified: cfe/trunk/test/CXX/dcl.decl/dcl.init/dcl.init.ref/p5-var.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/CXX/dcl.decl/dcl.init/dcl.init.ref/p5-var.cpp?rev=92832&r1=92831&r2=92832&view=diff
==============================================================================
--- cfe/trunk/test/CXX/dcl.decl/dcl.init/dcl.init.ref/p5-var.cpp (original)
+++ cfe/trunk/test/CXX/dcl.decl/dcl.init/dcl.init.ref/p5-var.cpp Wed Jan 6 03:43:14 2010
@@ -1,7 +1,7 @@
// RUN: %clang_cc1 -fsyntax-only -verify %s
-struct Base { }; // expected-note{{candidate function}}
-struct Derived : Base { }; // expected-note{{candidate function}}
+struct Base { }; // expected-note{{candidate is the implicit copy constructor}}
+struct Derived : Base { }; // expected-note{{candidate is the implicit copy constructor}}
struct Unrelated { };
struct Derived2 : Base { };
struct Diamond : Derived, Derived2 { };
Modified: cfe/trunk/test/CXX/temp/temp.decls/temp.class/temp.static/p1-inst.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/CXX/temp/temp.decls/temp.class/temp.static/p1-inst.cpp?rev=92832&r1=92831&r2=92832&view=diff
==============================================================================
--- cfe/trunk/test/CXX/temp/temp.decls/temp.class/temp.static/p1-inst.cpp (original)
+++ cfe/trunk/test/CXX/temp/temp.decls/temp.class/temp.static/p1-inst.cpp Wed Jan 6 03:43:14 2010
@@ -14,7 +14,7 @@
InitOkay(int) { }
};
-struct CannotInit { }; // expected-note{{candidate function}}
+struct CannotInit { }; // expected-note{{candidate is the implicit copy constructor}}
int &returnInt() { return X<int>::value; }
float &returnFloat() { return X<float>::value; }
Modified: cfe/trunk/test/CXX/temp/temp.decls/temp.class/temp.static/p1.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/CXX/temp/temp.decls/temp.class/temp.static/p1.cpp?rev=92832&r1=92831&r2=92832&view=diff
==============================================================================
--- cfe/trunk/test/CXX/temp/temp.decls/temp.class/temp.static/p1.cpp (original)
+++ cfe/trunk/test/CXX/temp/temp.decls/temp.class/temp.static/p1.cpp Wed Jan 6 03:43:14 2010
@@ -12,7 +12,7 @@
X1(int);
};
-struct X2 { }; // expected-note{{candidate function}}
+struct X2 { }; // expected-note{{candidate is the implicit copy constructor}}
int& get_int() { return X0<int>::value; }
X1& get_X1() { return X0<X1>::value; }
Modified: cfe/trunk/test/CXX/temp/temp.param/p3.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/CXX/temp/temp.param/p3.cpp?rev=92832&r1=92831&r2=92832&view=diff
==============================================================================
--- cfe/trunk/test/CXX/temp/temp.param/p3.cpp (original)
+++ cfe/trunk/test/CXX/temp/temp.param/p3.cpp Wed Jan 6 03:43:14 2010
@@ -15,7 +15,7 @@
// could be interpreted as either a non-type template-parameter or a
// type-parameter (because its identifier is the name of an already
// existing class) is taken as a type-parameter. For example,
-class T { /* ... */ }; // expected-note{{candidate function}}
+class T { /* ... */ }; // expected-note{{candidate is the implicit copy constructor}}
int i;
template<class T, T i> struct X2 {
Modified: cfe/trunk/test/CXX/temp/temp.spec/temp.expl.spec/p15.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/CXX/temp/temp.spec/temp.expl.spec/p15.cpp?rev=92832&r1=92831&r2=92832&view=diff
==============================================================================
--- cfe/trunk/test/CXX/temp/temp.spec/temp.expl.spec/p15.cpp (original)
+++ cfe/trunk/test/CXX/temp/temp.spec/temp.expl.spec/p15.cpp Wed Jan 6 03:43:14 2010
@@ -1,7 +1,7 @@
// RUN: %clang_cc1 -fsyntax-only -verify %s
struct NonDefaultConstructible {
- NonDefaultConstructible(const NonDefaultConstructible&); // expected-note{{candidate function}}
+ NonDefaultConstructible(const NonDefaultConstructible&); // expected-note{{candidate constructor}}
};
template<typename T, typename U>
Modified: cfe/trunk/test/CXX/temp/temp.spec/temp.expl.spec/p4.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/CXX/temp/temp.spec/temp.expl.spec/p4.cpp?rev=92832&r1=92831&r2=92832&view=diff
==============================================================================
--- cfe/trunk/test/CXX/temp/temp.spec/temp.expl.spec/p4.cpp (original)
+++ cfe/trunk/test/CXX/temp/temp.spec/temp.expl.spec/p4.cpp Wed Jan 6 03:43:14 2010
@@ -1,7 +1,7 @@
// RUN: %clang_cc1 -fsyntax-only -verify %s
-struct IntHolder { // expected-note{{here}} // expected-note 2{{candidate function}}
- IntHolder(int); // expected-note 2{{candidate function}}
+struct IntHolder { // expected-note{{here}} // expected-note 2{{candidate is the implicit copy constructor}}
+ IntHolder(int); // expected-note 2{{candidate constructor}}
};
template<typename T, typename U>
Modified: cfe/trunk/test/CXX/temp/temp.spec/temp.explicit/p1.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/CXX/temp/temp.spec/temp.explicit/p1.cpp?rev=92832&r1=92831&r2=92832&view=diff
==============================================================================
--- cfe/trunk/test/CXX/temp/temp.spec/temp.explicit/p1.cpp (original)
+++ cfe/trunk/test/CXX/temp/temp.spec/temp.explicit/p1.cpp Wed Jan 6 03:43:14 2010
@@ -48,8 +48,8 @@
// Explicitly instantiate members of a class template
struct Incomplete; // expected-note{{forward declaration}}
-struct NonDefaultConstructible { // expected-note{{candidate function}}
- NonDefaultConstructible(int); // expected-note{{candidate function}}
+struct NonDefaultConstructible { // expected-note{{candidate is the implicit copy constructor}}
+ NonDefaultConstructible(int); // expected-note{{candidate constructor}}
};
template<typename T, typename U>
Modified: cfe/trunk/test/SemaCXX/condition.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/SemaCXX/condition.cpp?rev=92832&r1=92831&r2=92832&view=diff
==============================================================================
--- cfe/trunk/test/SemaCXX/condition.cpp (original)
+++ cfe/trunk/test/SemaCXX/condition.cpp Wed Jan 6 03:43:14 2010
@@ -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}}
Modified: cfe/trunk/test/SemaCXX/constructor-initializer.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/SemaCXX/constructor-initializer.cpp?rev=92832&r1=92831&r2=92832&view=diff
==============================================================================
--- cfe/trunk/test/SemaCXX/constructor-initializer.cpp (original)
+++ cfe/trunk/test/SemaCXX/constructor-initializer.cpp Wed Jan 6 03:43:14 2010
@@ -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 {
Modified: cfe/trunk/test/SemaCXX/conversion-function.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/SemaCXX/conversion-function.cpp?rev=92832&r1=92831&r2=92832&view=diff
==============================================================================
--- cfe/trunk/test/SemaCXX/conversion-function.cpp (original)
+++ cfe/trunk/test/SemaCXX/conversion-function.cpp Wed Jan 6 03:43:14 2010
@@ -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}}
Modified: cfe/trunk/test/SemaCXX/converting-constructor.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/SemaCXX/converting-constructor.cpp?rev=92832&r1=92831&r2=92832&view=diff
==============================================================================
--- cfe/trunk/test/SemaCXX/converting-constructor.cpp (original)
+++ cfe/trunk/test/SemaCXX/converting-constructor.cpp Wed Jan 6 03:43:14 2010
@@ -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);
};
Modified: cfe/trunk/test/SemaCXX/copy-initialization.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/SemaCXX/copy-initialization.cpp?rev=92832&r1=92831&r2=92832&view=diff
==============================================================================
--- cfe/trunk/test/SemaCXX/copy-initialization.cpp (original)
+++ cfe/trunk/test/SemaCXX/copy-initialization.cpp Wed Jan 6 03:43:14 2010
@@ -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*);
};
Modified: cfe/trunk/test/SemaCXX/dcl_init_aggr.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/SemaCXX/dcl_init_aggr.cpp?rev=92832&r1=92831&r2=92832&view=diff
==============================================================================
--- cfe/trunk/test/SemaCXX/dcl_init_aggr.cpp (original)
+++ cfe/trunk/test/SemaCXX/dcl_init_aggr.cpp Wed Jan 6 03:43:14 2010
@@ -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}}
Modified: cfe/trunk/test/SemaCXX/decl-init-ref.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/SemaCXX/decl-init-ref.cpp?rev=92832&r1=92831&r2=92832&view=diff
==============================================================================
--- cfe/trunk/test/SemaCXX/decl-init-ref.cpp (original)
+++ cfe/trunk/test/SemaCXX/decl-init-ref.cpp Wed Jan 6 03:43:14 2010
@@ -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}}
Modified: cfe/trunk/test/SemaCXX/default2.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/SemaCXX/default2.cpp?rev=92832&r1=92831&r2=92832&view=diff
==============================================================================
--- cfe/trunk/test/SemaCXX/default2.cpp (original)
+++ cfe/trunk/test/SemaCXX/default2.cpp Wed Jan 6 03:43:14 2010
@@ -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
Modified: cfe/trunk/test/SemaCXX/direct-initializer.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/SemaCXX/direct-initializer.cpp?rev=92832&r1=92831&r2=92832&view=diff
==============================================================================
--- cfe/trunk/test/SemaCXX/direct-initializer.cpp (original)
+++ cfe/trunk/test/SemaCXX/direct-initializer.cpp Wed Jan 6 03:43:14 2010
@@ -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() {
Modified: cfe/trunk/test/SemaCXX/functional-cast.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/SemaCXX/functional-cast.cpp?rev=92832&r1=92831&r2=92832&view=diff
==============================================================================
--- cfe/trunk/test/SemaCXX/functional-cast.cpp (original)
+++ cfe/trunk/test/SemaCXX/functional-cast.cpp Wed Jan 6 03:43:14 2010
@@ -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() {
Modified: cfe/trunk/test/SemaCXX/namespace.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/SemaCXX/namespace.cpp?rev=92832&r1=92831&r2=92832&view=diff
==============================================================================
--- cfe/trunk/test/SemaCXX/namespace.cpp (original)
+++ cfe/trunk/test/SemaCXX/namespace.cpp Wed Jan 6 03:43:14 2010
@@ -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}}
Modified: cfe/trunk/test/SemaCXX/nested-name-spec.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/SemaCXX/nested-name-spec.cpp?rev=92832&r1=92831&r2=92832&view=diff
==============================================================================
--- cfe/trunk/test/SemaCXX/nested-name-spec.cpp (original)
+++ cfe/trunk/test/SemaCXX/nested-name-spec.cpp Wed Jan 6 03:43:14 2010
@@ -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>
Modified: cfe/trunk/test/SemaCXX/overloaded-builtin-operators.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/SemaCXX/overloaded-builtin-operators.cpp?rev=92832&r1=92831&r2=92832&view=diff
==============================================================================
--- cfe/trunk/test/SemaCXX/overloaded-builtin-operators.cpp (original)
+++ cfe/trunk/test/SemaCXX/overloaded-builtin-operators.cpp Wed Jan 6 03:43:14 2010
@@ -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&();
};
Modified: cfe/trunk/test/SemaCXX/rval-references.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/SemaCXX/rval-references.cpp?rev=92832&r1=92831&r2=92832&view=diff
==============================================================================
--- cfe/trunk/test/SemaCXX/rval-references.cpp (original)
+++ cfe/trunk/test/SemaCXX/rval-references.cpp Wed Jan 6 03:43:14 2010
@@ -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;
Modified: cfe/trunk/test/SemaTemplate/constructor-template.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/SemaTemplate/constructor-template.cpp?rev=92832&r1=92831&r2=92832&view=diff
==============================================================================
--- cfe/trunk/test/SemaTemplate/constructor-template.cpp (original)
+++ cfe/trunk/test/SemaTemplate/constructor-template.cpp Wed Jan 6 03:43:14 2010
@@ -52,8 +52,8 @@
struct B { A<int> x; B(B& a) : x(a.x) {} };
struct X2 {
- X2(); // expected-note{{candidate function}}
- X2(X2&); // expected-note {{candidate function}}
+ X2(); // expected-note{{candidate constructor}}
+ X2(X2&); // expected-note {{candidate constructor}}
template<typename T> X2(T);
};
@@ -71,9 +71,9 @@
template<> X3::X3(X3); // expected-error{{must pass its first argument by reference}}
struct X4 {
- X4(); // expected-note{{candidate function}}
+ X4(); // expected-note{{candidate constructor}}
~X4();
- X4(X4&); // expected-note {{candidate function}}
+ X4(X4&); // expected-note {{candidate constructor}}
template<typename T> X4(const T&, int = 17);
};
Modified: cfe/trunk/test/SemaTemplate/default-expr-arguments.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/SemaTemplate/default-expr-arguments.cpp?rev=92832&r1=92831&r2=92832&view=diff
==============================================================================
--- cfe/trunk/test/SemaTemplate/default-expr-arguments.cpp (original)
+++ cfe/trunk/test/SemaTemplate/default-expr-arguments.cpp Wed Jan 6 03:43:14 2010
@@ -5,7 +5,7 @@
template<>
C<char>::C(int a0);
-struct S { }; // expected-note 3 {{candidate function}}
+struct S { }; // expected-note 3 {{candidate is the implicit copy constructor}}
template<typename T> void f1(T a, T b = 10) { } // expected-error{{no viable conversion}}
Modified: cfe/trunk/test/SemaTemplate/explicit-instantiation.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/SemaTemplate/explicit-instantiation.cpp?rev=92832&r1=92831&r2=92832&view=diff
==============================================================================
--- cfe/trunk/test/SemaTemplate/explicit-instantiation.cpp (original)
+++ cfe/trunk/test/SemaTemplate/explicit-instantiation.cpp Wed Jan 6 03:43:14 2010
@@ -25,8 +25,8 @@
template int X0<int>::value;
-struct NotDefaultConstructible { // expected-note{{candidate function}}
- NotDefaultConstructible(int); // expected-note{{candidate function}}
+struct NotDefaultConstructible { // expected-note{{candidate is the implicit copy constructor}}
+ NotDefaultConstructible(int); // expected-note{{candidate constructor}}
};
template NotDefaultConstructible X0<NotDefaultConstructible>::value; // expected-note{{instantiation}}
Modified: cfe/trunk/test/SemaTemplate/fun-template-def.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/SemaTemplate/fun-template-def.cpp?rev=92832&r1=92831&r2=92832&view=diff
==============================================================================
--- cfe/trunk/test/SemaTemplate/fun-template-def.cpp (original)
+++ cfe/trunk/test/SemaTemplate/fun-template-def.cpp Wed Jan 6 03:43:14 2010
@@ -8,7 +8,7 @@
// Fake typeid, lacking a typeinfo header.
namespace std { class type_info {}; }
-struct dummy {}; // expected-note 3 {{candidate function}}
+struct dummy {}; // expected-note 3 {{candidate is the implicit copy constructor}}
template<typename T>
int f0(T x) {
Modified: cfe/trunk/test/SemaTemplate/instantiate-expr-4.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/SemaTemplate/instantiate-expr-4.cpp?rev=92832&r1=92831&r2=92832&view=diff
==============================================================================
--- cfe/trunk/test/SemaTemplate/instantiate-expr-4.cpp (original)
+++ cfe/trunk/test/SemaTemplate/instantiate-expr-4.cpp Wed Jan 6 03:43:14 2010
@@ -21,8 +21,8 @@
template struct FunctionalCast0<5>;
-struct X { // expected-note 3 {{candidate function}}
- X(int, int); // expected-note 3 {{candidate function}}
+struct X { // expected-note 3 {{candidate is the implicit copy constructor}}
+ X(int, int); // expected-note 3 {{candidate constructor}}
};
template<int N, int M>
Modified: cfe/trunk/test/SemaTemplate/instantiate-static-var.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/SemaTemplate/instantiate-static-var.cpp?rev=92832&r1=92831&r2=92832&view=diff
==============================================================================
--- cfe/trunk/test/SemaTemplate/instantiate-static-var.cpp (original)
+++ cfe/trunk/test/SemaTemplate/instantiate-static-var.cpp Wed Jan 6 03:43:14 2010
@@ -30,7 +30,7 @@
struct DefCon {};
struct NoDefCon {
- NoDefCon(const NoDefCon&); // expected-note{{candidate function}}
+ NoDefCon(const NoDefCon&); // expected-note{{candidate constructor}}
};
void test() {
More information about the cfe-commits
mailing list