<div dir="ltr">Sorry for the breakage. Fix incoming as soon as my test suite run completes.</div><div class="gmail_extra"><br><div class="gmail_quote">On Tue, May 29, 2018 at 7:00 PM, Eric Fiselier via cfe-commits <span dir="ltr"><<a href="mailto:cfe-commits@lists.llvm.org" target="_blank">cfe-commits@lists.llvm.org</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Author: ericwf<br>
Date: Tue May 29 18:00:41 2018<br>
New Revision: 333485<br>
<br>
URL: <a href="http://llvm.org/viewvc/llvm-project?rev=333485&view=rev" rel="noreferrer" target="_blank">http://llvm.org/viewvc/llvm-<wbr>project?rev=333485&view=rev</a><br>
Log:<br>
[Sema] Use %sub to cleanup overload diagnostics<br>
<br>
Summary:<br>
This patch adds the newly added `%sub` diagnostic modifier to cleanup repetition in the overload candidate diagnostics.<br>
<br>
I think this should be good to go.<br>
<br>
@rsmith: Some of the notes now emit `function template` where they only said `function` previously. It seems OK to me, but I would like your sign off on it.<br>
<br>
<br>
Reviewers: rsmith, EricWF<br>
<br>
Reviewed By: EricWF<br>
<br>
Subscribers: cfe-commits, rsmith<br>
<br>
Differential Revision: <a href="https://reviews.llvm.org/D47101" rel="noreferrer" target="_blank">https://reviews.llvm.org/<wbr>D47101</a><br>
<br>
Modified:<br>
cfe/trunk/include/clang/Basic/<wbr>DiagnosticSemaKinds.td<br>
cfe/trunk/lib/Sema/<wbr>SemaOverload.cpp<br>
cfe/trunk/test/CXX/drs/dr4xx.<wbr>cpp<br>
cfe/trunk/test/CXX/special/<wbr>class.inhctor/p1.cpp<br>
cfe/trunk/test/SemaCXX/attr-<wbr>noreturn.cpp<br>
cfe/trunk/test/SemaCXX/cxx1y-<wbr>generic-lambdas.cpp<br>
cfe/trunk/test/SemaCXX/<wbr>overload-call.cpp<br>
cfe/trunk/test/SemaCXX/<wbr>overload-member-call.cpp<br>
<br>
Modified: cfe/trunk/include/clang/Basic/<wbr>DiagnosticSemaKinds.td<br>
URL: <a href="http://llvm.org/viewvc/llvm-project/cfe/trunk/include/clang/Basic/DiagnosticSemaKinds.td?rev=333485&r1=333484&r2=333485&view=diff" rel="noreferrer" target="_blank">http://llvm.org/viewvc/llvm-<wbr>project/cfe/trunk/include/<wbr>clang/Basic/<wbr>DiagnosticSemaKinds.td?rev=<wbr>333485&r1=333484&r2=333485&<wbr>view=diff</a><br>
==============================<wbr>==============================<wbr>==================<br>
--- cfe/trunk/include/clang/Basic/<wbr>DiagnosticSemaKinds.td (original)<br>
+++ cfe/trunk/include/clang/Basic/<wbr>DiagnosticSemaKinds.td Tue May 29 18:00:41 2018<br>
@@ -3525,27 +3525,29 @@ def err_ovl_deleted_member_call : Error<<br>
def note_ovl_too_many_candidates : Note<<br>
"remaining %0 candidate%s0 omitted; "<br>
"pass -fshow-overloads=all to show them">;<br>
-def note_ovl_candidate : Note<"candidate "<br>
- "%select{function|function|<wbr>constructor|"<br>
- "function |function |constructor |"<br>
- "is the implicit default constructor|"<br>
- "is the implicit copy constructor|"<br>
- "is the implicit move constructor|"<br>
- "is the implicit copy assignment operator|"<br>
- "is the implicit move assignment operator|"<br>
- "inherited constructor|"<br>
- "inherited constructor }0%2"<br>
- "%select{| has different class%diff{ (expected $ but has $)|}4,5"<br>
- "| has different number of parameters (expected %4 but has %5)"<br>
- "| has type mismatch at %ordinal4 parameter"<br>
- "%diff{ (expected $ but has $)|}5,6"<br>
- "| has different return type%diff{ ($ expected but has $)|}4,5"<br>
+<br>
+def select_ovl_candidate_kind : TextSubstitution<<br>
+ "%select{function|function|<wbr>constructor|"<br>
+ "constructor (the implicit default constructor)|"<br>
+ "constructor (the implicit copy constructor)|"<br>
+ "constructor (the implicit move constructor)|"<br>
+ "function (the implicit copy assignment operator)|"<br>
+ "function (the implicit move assignment operator)|"<br>
+ "inherited constructor}0%select{| template| %2}1">;<br>
+<br>
+def note_ovl_candidate : Note<<br>
+ "candidate %sub{select_ovl_candidate_<wbr>kind}0,1,3"<br>
+ "%select{| has different class%diff{ (expected $ but has $)|}5,6"<br>
+ "| has different number of parameters (expected %5 but has %6)"<br>
+ "| has type mismatch at %ordinal5 parameter"<br>
+ "%diff{ (expected $ but has $)|}6,7"<br>
+ "| has different return type%diff{ ($ expected but has $)|}5,6"<br>
"| has different qualifiers (expected "<br>
"%select{none|const|restrict|<wbr>const and restrict|volatile|const and volatile"<br>
- "|volatile and restrict|const, volatile, and restrict}4 but found "<br>
+ "|volatile and restrict|const, volatile, and restrict}5 but found "<br>
"%select{none|const|restrict|<wbr>const and restrict|volatile|const and volatile"<br>
- "|volatile and restrict|const, volatile, and restrict}5)"<br>
- "| has different exception specification}3">;<br>
+ "|volatile and restrict|const, volatile, and restrict}6)"<br>
+ "| has different exception specification}4">;<br>
<br>
def note_ovl_candidate_inherited_<wbr>constructor : Note<<br>
"constructor from base class %0 inherited here">;<br>
@@ -3615,225 +3617,97 @@ def note_ovl_candidate_non_<wbr>deduced_misma<br>
<br>
// Note that we don't treat templates differently for this diagnostic.<br>
def note_ovl_candidate_arity : Note<"candidate "<br>
- "%select{function|function|<wbr>constructor|function|function|<wbr>constructor|"<br>
- "constructor (the implicit default constructor)|"<br>
- "constructor (the implicit copy constructor)|"<br>
- "constructor (the implicit move constructor)|"<br>
- "function (the implicit copy assignment operator)|"<br>
- "function (the implicit move assignment operator)|"<br>
- "inherited constructor|"<br>
- "inherited constructor}0 %select{|template }1"<br>
- "not viable: requires%select{ at least| at most|}2 %3 argument%s3, but %4 "<br>
- "%plural{1:was|:were}4 provided">;<br>
+ "%sub{select_ovl_candidate_<wbr>kind}0,1,2 not viable: "<br>
+ "requires%select{ at least| at most|}3 %4 argument%s4, but %5 "<br>
+ "%plural{1:was|:were}5 provided">;<br>
<br>
def note_ovl_candidate_arity_one : Note<"candidate "<br>
- "%select{function|function|<wbr>constructor|function|function|<wbr>constructor|"<br>
- "constructor (the implicit default constructor)|"<br>
- "constructor (the implicit copy constructor)|"<br>
- "constructor (the implicit move constructor)|"<br>
- "function (the implicit copy assignment operator)|"<br>
- "function (the implicit move assignment operator)|"<br>
- "inherited constructor|"<br>
- "inherited constructor}0 %select{|template }1not viable: "<br>
- "%select{requires at least|allows at most single|requires single}2 "<br>
- "argument %3, but %plural{0:no|:%4}4 arguments were provided">;<br>
+ "%sub{select_ovl_candidate_<wbr>kind}0,1,2 not viable: "<br>
+ "%select{requires at least|allows at most single|requires single}3 "<br>
+ "argument %4, but %plural{0:no|:%5}5 arguments were provided">;<br>
<br>
def note_ovl_candidate_deleted : Note<<br>
- "candidate %select{function|function|<wbr>constructor|"<br>
- "function |function |constructor |"<br>
- "constructor (the implicit default constructor)|"<br>
- "constructor (the implicit copy constructor)|"<br>
- "constructor (the implicit move constructor)|"<br>
- "function (the implicit copy assignment operator)|"<br>
- "function (the implicit move assignment operator)|"<br>
- "inherited constructor|"<br>
- "inherited constructor }0%1 has been "<br>
+ "candidate %sub{select_ovl_candidate_<wbr>kind}0,1,2 has been "<br>
"%select{explicitly made unavailable|explicitly deleted|"<br>
- "implicitly deleted}2">;<br>
+ "implicitly deleted}3">;<br>
<br>
// Giving the index of the bad argument really clutters this message, and<br>
// it's relatively unimportant because 1) it's generally obvious which<br>
// argument(s) are of the given object type and 2) the fix is usually<br>
// to complete the type, which doesn't involve changes to the call line<br>
// anyway. If people complain, we can change it.<br>
-def note_ovl_candidate_bad_conv_<wbr>incomplete : Note<"candidate "<br>
- "%select{function|function|<wbr>constructor|"<br>
- "function |function |constructor |"<br>
- "constructor (the implicit default constructor)|"<br>
- "constructor (the implicit copy constructor)|"<br>
- "constructor (the implicit move constructor)|"<br>
- "function (the implicit copy assignment operator)|"<br>
- "function (the implicit move assignment operator)|"<br>
- "inherited constructor|"<br>
- "inherited constructor }0%1 "<br>
- "not viable: cannot convert argument of incomplete type "<br>
- "%diff{$ to $|to parameter type}2,3 for "<br>
- "%select{%ordinal5 argument|object argument}4"<br>
+def note_ovl_candidate_bad_conv_<wbr>incomplete : Note<<br>
+ "candidate %sub{select_ovl_candidate_<wbr>kind}0,1,2 not viable: "<br>
+ "cannot convert argument of incomplete type "<br>
+ "%diff{$ to $|to parameter type}3,4 for "<br>
+ "%select{%ordinal6 argument|object argument}5"<br>
"%select{|; dereference the argument with *|"<br>
"; take the address of the argument with &|"<br>
"; remove *|"<br>
- "; remove &}6">;<br>
-def note_ovl_candidate_bad_list_<wbr>argument : Note<"candidate "<br>
- "%select{function|function|<wbr>constructor|"<br>
- "function |function |constructor |"<br>
- "constructor (the implicit default constructor)|"<br>
- "constructor (the implicit copy constructor)|"<br>
- "constructor (the implicit move constructor)|"<br>
- "function (the implicit copy assignment operator)|"<br>
- "function (the implicit move assignment operator)|"<br>
- "inherited constructor|"<br>
- "inherited constructor }0%1 "<br>
- "not viable: cannot convert initializer list argument to %3">;<br>
-def note_ovl_candidate_bad_<wbr>overload : Note<"candidate "<br>
- "%select{function|function|<wbr>constructor|"<br>
- "function |function |constructor |"<br>
- "constructor (the implicit default constructor)|"<br>
- "constructor (the implicit copy constructor)|"<br>
- "constructor (the implicit move constructor)|"<br>
- "function (the implicit copy assignment operator)|"<br>
- "function (the implicit move assignment operator)|"<br>
- "inherited constructor|"<br>
- "inherited constructor }0%1"<br>
- " not viable: no overload of %3 matching %2 for %ordinal4 argument">;<br>
-def note_ovl_candidate_bad_conv : Note<"candidate "<br>
- "%select{function|function|<wbr>constructor|"<br>
- "function |function |constructor |"<br>
- "constructor (the implicit default constructor)|"<br>
- "constructor (the implicit copy constructor)|"<br>
- "constructor (the implicit move constructor)|"<br>
- "function (the implicit copy assignment operator)|"<br>
- "function (the implicit move assignment operator)|"<br>
- "inherited constructor|"<br>
- "inherited constructor }0%1"<br>
- " not viable: no known conversion "<br>
- "%diff{from $ to $|from argument type to parameter type}2,3 for "<br>
- "%select{%ordinal5 argument|object argument}4"<br>
+ "; remove &}7">;<br>
+def note_ovl_candidate_bad_list_<wbr>argument : Note<<br>
+ "candidate %sub{select_ovl_candidate_<wbr>kind}0,1,2 not viable: "<br>
+ "cannot convert initializer list argument to %4">;<br>
+def note_ovl_candidate_bad_<wbr>overload : Note<<br>
+ "candidate %sub{select_ovl_candidate_<wbr>kind}0,1,2 not viable: "<br>
+ "no overload of %4 matching %3 for %ordinal5 argument">;<br>
+def note_ovl_candidate_bad_conv : Note<<br>
+ "candidate %sub{select_ovl_candidate_<wbr>kind}0,1,2 not viable: "<br>
+ "no known conversion "<br>
+ "%diff{from $ to $|from argument type to parameter type}3,4 for "<br>
+ "%select{%ordinal6 argument|object argument}5"<br>
"%select{|; dereference the argument with *|"<br>
"; take the address of the argument with &|"<br>
"; remove *|"<br>
- "; remove &}6">;<br>
-def note_ovl_candidate_bad_arc_<wbr>conv : Note<"candidate "<br>
- "%select{function|function|<wbr>constructor|"<br>
- "function |function |constructor |"<br>
- "constructor (the implicit default constructor)|"<br>
- "constructor (the implicit copy constructor)|"<br>
- "constructor (the implicit move constructor)|"<br>
- "function (the implicit copy assignment operator)|"<br>
- "function (the implicit move assignment operator)|"<br>
- "inherited constructor|"<br>
- "inherited constructor }0%1"<br>
- " not viable: cannot implicitly convert argument "<br>
- "%diff{of type $ to $|type to parameter type}2,3 for "<br>
- "%select{%ordinal5 argument|object argument}4 under ARC">;<br>
-def note_ovl_candidate_bad_lvalue : Note<"candidate "<br>
- "%select{function|function|<wbr>constructor|"<br>
- "function |function |constructor |"<br>
- "constructor (the implicit default constructor)|"<br>
- "constructor (the implicit copy constructor)|"<br>
- "constructor (the implicit move constructor)|"<br>
- "function (the implicit copy assignment operator)|"<br>
- "function (the implicit move assignment operator)|"<br>
- "inherited constructor|"<br>
- "inherited constructor }0%1"<br>
- " not viable: expects an l-value for "<br>
- "%select{%ordinal3 argument|object argument}2">;<br>
-def note_ovl_candidate_bad_<wbr>addrspace : Note<"candidate "<br>
- "%select{function|function|<wbr>constructor|"<br>
- "function |function |constructor |"<br>
- "constructor (the implicit default constructor)|"<br>
- "constructor (the implicit copy constructor)|"<br>
- "constructor (the implicit move constructor)|"<br>
- "function (the implicit copy assignment operator)|"<br>
- "function (the implicit move assignment operator)|"<br>
- "inherited constructor|"<br>
- "inherited constructor }0%1 not viable: "<br>
- "%select{%ordinal6|'this'}5 argument (%2) is in "<br>
- "address space %3, but parameter must be in address space %4">;<br>
-def note_ovl_candidate_bad_gc : Note<"candidate "<br>
- "%select{function|function|<wbr>constructor|"<br>
- "function |function |constructor |"<br>
- "constructor (the implicit default constructor)|"<br>
- "constructor (the implicit copy constructor)|"<br>
- "constructor (the implicit move constructor)|"<br>
- "function (the implicit copy assignment operator)|"<br>
- "function (the implicit move assignment operator)|"<br>
- "inherited constructor|"<br>
- "inherited constructor }0%1 not viable: "<br>
- "%select{%ordinal6|'this'}5 argument (%2) has %select{no|__weak|__strong}3 "<br>
- "ownership, but parameter has %select{no|__weak|__strong}4 ownership">;<br>
-def note_ovl_candidate_bad_<wbr>ownership : Note<"candidate "<br>
- "%select{function|function|<wbr>constructor|"<br>
- "function |function |constructor |"<br>
- "constructor (the implicit default constructor)|"<br>
- "constructor (the implicit copy constructor)|"<br>
- "constructor (the implicit move constructor)|"<br>
- "function (the implicit copy assignment operator)|"<br>
- "function (the implicit move assignment operator)|"<br>
- "inherited constructor|"<br>
- "inherited constructor }0%1 not viable: "<br>
- "%select{%ordinal6|'this'}5 argument (%2) has "<br>
- "%select{no|__unsafe_<wbr>unretained|__strong|__weak|__<wbr>autoreleasing}3 ownership,"<br>
+ "; remove &}7">;<br>
+def note_ovl_candidate_bad_arc_<wbr>conv : Note<<br>
+ "candidate %sub{select_ovl_candidate_<wbr>kind}0,1,2 not viable: "<br>
+ "cannot implicitly convert argument "<br>
+ "%diff{of type $ to $|type to parameter type}3,4 for "<br>
+ "%select{%ordinal6 argument|object argument}5 under ARC">;<br>
+def note_ovl_candidate_bad_lvalue : Note<<br>
+ "candidate %sub{select_ovl_candidate_<wbr>kind}0,1,2 not viable: "<br>
+ "expects an l-value for "<br>
+ "%select{%ordinal4 argument|object argument}3">;<br>
+def note_ovl_candidate_bad_<wbr>addrspace : Note<<br>
+ "candidate %sub{select_ovl_candidate_<wbr>kind}0,1,2 not viable: "<br>
+ "%select{%ordinal7|'this'}6 argument (%3) is in "<br>
+ "address space %4, but parameter must be in address space %5">;<br>
+def note_ovl_candidate_bad_gc : Note<<br>
+ "candidate %sub{select_ovl_candidate_<wbr>kind}0,1,2 not viable: "<br>
+ "%select{%ordinal7|'this'}6 argument (%3) has %select{no|__weak|__strong}4 "<br>
+ "ownership, but parameter has %select{no|__weak|__strong}5 ownership">;<br>
+def note_ovl_candidate_bad_<wbr>ownership : Note<<br>
+ "candidate %sub{select_ovl_candidate_<wbr>kind}0,1,2 not viable: "<br>
+ "%select{%ordinal7|'this'}6 argument (%3) has "<br>
+ "%select{no|__unsafe_<wbr>unretained|__strong|__weak|__<wbr>autoreleasing}4 ownership,"<br>
" but parameter has %select{no|__unsafe_<wbr>unretained|__strong|__weak|"<br>
- "__autoreleasing}4 ownership">;<br>
-def note_ovl_candidate_bad_cvr_<wbr>this : Note<"candidate "<br>
- "%select{|function|||function|<wbr>||||"<br>
- "function (the implicit copy assignment operator)|"<br>
- "function (the implicit move assignment operator)||}0 not viable: "<br>
- "'this' argument has type %2, but method is not marked "<br>
+ "__autoreleasing}5 ownership">;<br>
+def note_ovl_candidate_bad_cvr_<wbr>this : Note<<br>
+ "candidate %sub{select_ovl_candidate_<wbr>kind}0,1,2 not viable: "<br>
+ "'this' argument has type %3, but method is not marked "<br>
"%select{const|restrict|const or restrict|volatile|const or volatile|"<br>
- "volatile or restrict|const, volatile, or restrict}3">;<br>
-def note_ovl_candidate_bad_cvr : Note<"candidate "<br>
- "%select{function|function|<wbr>constructor|"<br>
- "function |function |constructor |"<br>
- "constructor (the implicit default constructor)|"<br>
- "constructor (the implicit copy constructor)|"<br>
- "constructor (the implicit move constructor)|"<br>
- "function (the implicit copy assignment operator)|"<br>
- "function (the implicit move assignment operator)|"<br>
- "inherited constructor|"<br>
- "inherited constructor }0%1 not viable: "<br>
- "%ordinal4 argument (%2) would lose "<br>
+ "volatile or restrict|const, volatile, or restrict}4">;<br>
+def note_ovl_candidate_bad_cvr : Note<<br>
+ "candidate %sub{select_ovl_candidate_<wbr>kind}0,1,2 not viable: "<br>
+ "%ordinal5 argument (%3) would lose "<br>
"%select{const|restrict|const and restrict|volatile|const and volatile|"<br>
- "volatile and restrict|const, volatile, and restrict}3 qualifier"<br>
- "%select{||s||s|s|s}3">;<br>
-def note_ovl_candidate_bad_<wbr>unaligned : Note<"candidate "<br>
- "%select{function|function|<wbr>constructor|"<br>
- "function |function |constructor |"<br>
- "constructor (the implicit default constructor)|"<br>
- "constructor (the implicit copy constructor)|"<br>
- "constructor (the implicit move constructor)|"<br>
- "function (the implicit copy assignment operator)|"<br>
- "function (the implicit move assignment operator)|"<br>
- "inherited constructor|"<br>
- "inherited constructor }0%1 not viable: "<br>
- "%ordinal4 argument (%2) would lose __unaligned qualifier">;<br>
-def note_ovl_candidate_bad_base_<wbr>to_derived_conv : Note<"candidate "<br>
- "%select{function|function|<wbr>constructor|"<br>
- "function |function |constructor |"<br>
- "constructor (the implicit default constructor)|"<br>
- "constructor (the implicit copy constructor)|"<br>
- "constructor (the implicit move constructor)|"<br>
- "function (the implicit copy assignment operator)|"<br>
- "function (the implicit move assignment operator)|"<br>
- "inherited constructor|"<br>
- "inherited constructor }0%1 not viable: "<br>
- "cannot %select{convert from|convert from|bind}2 "<br>
- "%select{base class pointer|superclass|base class object of type}2 %3 to "<br>
- "%select{derived class pointer|subclass|derived class reference}2 %4 for "<br>
- "%ordinal5 argument">;<br>
+ "volatile and restrict|const, volatile, and restrict}4 qualifier"<br>
+ "%select{||s||s|s|s}4">;<br>
+def note_ovl_candidate_bad_<wbr>unaligned : Note<<br>
+ "candidate %sub{select_ovl_candidate_<wbr>kind}0,1,2 not viable: "<br>
+ "%ordinal5 argument (%3) would lose __unaligned qualifier">;<br>
+def note_ovl_candidate_bad_base_<wbr>to_derived_conv : Note<<br>
+ "candidate %sub{select_ovl_candidate_<wbr>kind}0,1,2 not viable: "<br>
+ "cannot %select{convert from|convert from|bind}3 "<br>
+ "%select{base class pointer|superclass|base class object of type}3 %4 to "<br>
+ "%select{derived class pointer|subclass|derived class reference}3 %5 for "<br>
+ "%ordinal6 argument">;<br>
def note_ovl_candidate_bad_target : Note<<br>
- "candidate %select{function|function|<wbr>constructor|"<br>
- "function|function|<wbr>constructor|"<br>
- "constructor (the implicit default constructor)|"<br>
- "constructor (the implicit copy constructor)|"<br>
- "constructor (the implicit move constructor)|"<br>
- "function (the implicit copy assignment operator)|"<br>
- "function (the implicit move assignment operator)|"<br>
- "inherited constructor|"<br>
- "inherited constructor}0 not viable: "<br>
+ "candidate %sub{select_ovl_candidate_<wbr>kind}0,1,2 not viable: "<br>
"call to "<br>
- "%select{__device__|__global__<wbr>|__host__|__host__ __device__|invalid}1 function from"<br>
- " %select{__device__|__global__|<wbr>__host__|__host__ __device__|invalid}2 function">;<br>
+ "%select{__device__|__global__<wbr>|__host__|__host__ __device__|invalid}3 function from"<br>
+ " %select{__device__|__global__|<wbr>__host__|__host__ __device__|invalid}4 function">;<br>
def note_implicit_member_target_<wbr>infer_collision : Note<<br>
"implicit %sub{select_special_member_<wbr>kind}0 inferred target collision: call to both "<br>
"%select{__device__|__global__<wbr>|__host__|__host__ __device__}1 and "<br>
<br>
Modified: cfe/trunk/lib/Sema/<wbr>SemaOverload.cpp<br>
URL: <a href="http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Sema/SemaOverload.cpp?rev=333485&r1=333484&r2=333485&view=diff" rel="noreferrer" target="_blank">http://llvm.org/viewvc/llvm-<wbr>project/cfe/trunk/lib/Sema/<wbr>SemaOverload.cpp?rev=333485&<wbr>r1=333484&r2=333485&view=diff</a><br>
==============================<wbr>==============================<wbr>==================<br>
--- cfe/trunk/lib/Sema/<wbr>SemaOverload.cpp (original)<br>
+++ cfe/trunk/lib/Sema/<wbr>SemaOverload.cpp Tue May 29 18:00:41 2018<br>
@@ -9327,66 +9327,77 @@ enum OverloadCandidateKind {<br>
oc_function,<br>
oc_method,<br>
oc_constructor,<br>
- oc_function_template,<br>
- oc_method_template,<br>
- oc_constructor_template,<br>
oc_implicit_default_<wbr>constructor,<br>
oc_implicit_copy_constructor,<br>
oc_implicit_move_constructor,<br>
oc_implicit_copy_assignment,<br>
oc_implicit_move_assignment,<br>
- oc_inherited_constructor,<br>
- oc_inherited_constructor_<wbr>template<br>
+ oc_inherited_constructor<br>
};<br>
<br>
-static OverloadCandidateKind<br>
+enum OverloadCandidateSelect {<br>
+ ocs_non_template,<br>
+ ocs_template,<br>
+ ocs_described_template,<br>
+};<br>
+<br>
+static std::pair<<wbr>OverloadCandidateKind, OverloadCandidateSelect><br>
ClassifyOverloadCandidate(Sema &S, NamedDecl *Found, FunctionDecl *Fn,<br>
std::string &Description) {<br>
- bool isTemplate = false;<br>
<br>
+ bool isTemplate = Fn->isTemplateDecl() || Found->isTemplateDecl();<br>
if (FunctionTemplateDecl *FunTmpl = Fn->getPrimaryTemplate()) {<br>
isTemplate = true;<br>
Description = S.<wbr>getTemplateArgumentBindingsTex<wbr>t(<br>
- FunTmpl-><wbr>getTemplateParameters(), *Fn-><wbr>getTemplateSpecializationArgs(<wbr>));<br>
+ FunTmpl-><wbr>getTemplateParameters(), *Fn-><wbr>getTemplateSpecializationArgs(<wbr>));<br>
}<br>
<br>
- if (CXXConstructorDecl *Ctor = dyn_cast<CXXConstructorDecl>(<wbr>Fn)) {<br>
- if (!Ctor->isImplicit()) {<br>
- if (isa<<wbr>ConstructorUsingShadowDecl>(<wbr>Found))<br>
- return isTemplate ? oc_inherited_constructor_<wbr>template<br>
- : oc_inherited_constructor;<br>
- else<br>
- return isTemplate ? oc_constructor_template : oc_constructor;<br>
- }<br>
+ OverloadCandidateSelect Select = [&]() {<br>
+ if (!Description.empty())<br>
+ return ocs_described_template;<br>
+ return isTemplate ? ocs_template : ocs_non_template;<br>
+ }();<br>
+<br>
+ OverloadCandidateKind Kind = [&]() {<br>
+ if (CXXConstructorDecl *Ctor = dyn_cast<CXXConstructorDecl>(<wbr>Fn)) {<br>
+ if (!Ctor->isImplicit()) {<br>
+ if (isa<<wbr>ConstructorUsingShadowDecl>(<wbr>Found))<br>
+ return oc_inherited_constructor;<br>
+ else<br>
+ return oc_constructor;<br>
+ }<br>
<br>
- if (Ctor->isDefaultConstructor())<br>
- return oc_implicit_default_<wbr>constructor;<br>
+ if (Ctor->isDefaultConstructor())<br>
+ return oc_implicit_default_<wbr>constructor;<br>
<br>
- if (Ctor->isMoveConstructor())<br>
- return oc_implicit_move_constructor;<br>
+ if (Ctor->isMoveConstructor())<br>
+ return oc_implicit_move_constructor;<br>
<br>
- assert(Ctor-><wbr>isCopyConstructor() &&<br>
- "unexpected sort of implicit constructor");<br>
- return oc_implicit_copy_constructor;<br>
- }<br>
+ assert(Ctor-><wbr>isCopyConstructor() &&<br>
+ "unexpected sort of implicit constructor");<br>
+ return oc_implicit_copy_constructor;<br>
+ }<br>
<br>
- if (CXXMethodDecl *Meth = dyn_cast<CXXMethodDecl>(Fn)) {<br>
- // This actually gets spelled 'candidate function' for now, but<br>
- // it doesn't hurt to split it out.<br>
- if (!Meth->isImplicit())<br>
- return isTemplate ? oc_method_template : oc_method;<br>
+ if (CXXMethodDecl *Meth = dyn_cast<CXXMethodDecl>(Fn)) {<br>
+ // This actually gets spelled 'candidate function' for now, but<br>
+ // it doesn't hurt to split it out.<br>
+ if (!Meth->isImplicit())<br>
+ return oc_method;<br>
<br>
- if (Meth-><wbr>isMoveAssignmentOperator())<br>
- return oc_implicit_move_assignment;<br>
+ if (Meth-><wbr>isMoveAssignmentOperator())<br>
+ return oc_implicit_move_assignment;<br>
<br>
- if (Meth-><wbr>isCopyAssignmentOperator())<br>
- return oc_implicit_copy_assignment;<br>
+ if (Meth-><wbr>isCopyAssignmentOperator())<br>
+ return oc_implicit_copy_assignment;<br>
<br>
- assert(isa<CXXConversionDecl>(<wbr>Meth) && "expected conversion");<br>
- return oc_method;<br>
- }<br>
+ assert(isa<CXXConversionDecl>(<wbr>Meth) && "expected conversion");<br>
+ return oc_method;<br>
+ }<br>
+<br>
+ return oc_function;<br>
+ }();<br>
<br>
- return isTemplate ? oc_function_template : oc_function;<br>
+ return std::make_pair(Kind, Select);<br>
}<br>
<br>
void MaybeEmitInheritedConstructorN<wbr>ote(Sema &S, Decl *FoundDecl) {<br>
@@ -9478,9 +9489,11 @@ void Sema::NoteOverloadCandidate(<wbr>NamedDe<br>
return;<br>
<br>
std::string FnDesc;<br>
- OverloadCandidateKind K = ClassifyOverloadCandidate(*<wbr>this, Found, Fn, FnDesc);<br>
+ std::pair<<wbr>OverloadCandidateKind, OverloadCandidateSelect> KSPair =<br>
+ ClassifyOverloadCandidate(*<wbr>this, Found, Fn, FnDesc);<br>
PartialDiagnostic PD = PDiag(diag::note_ovl_<wbr>candidate)<br>
- << (unsigned) K << Fn << FnDesc;<br>
+ << (unsigned)KSPair.first << (unsigned)KSPair.second<br>
+ << Fn << FnDesc;<br>
<br>
HandleFunctionTypeMismatch(PD, Fn->getType(), DestType);<br>
Diag(Fn->getLocation(), PD);<br>
@@ -9554,7 +9567,7 @@ static void DiagnoseBadConversion(Sema &<br>
}<br>
<br>
std::string FnDesc;<br>
- OverloadCandidateKind FnKind =<br>
+ std::pair<<wbr>OverloadCandidateKind, OverloadCandidateSelect> FnKindPair =<br>
ClassifyOverloadCandidate(S, Cand->FoundDecl, Fn, FnDesc);<br>
<br>
Expr *FromExpr = Conv.Bad.FromExpr;<br>
@@ -9569,9 +9582,9 @@ static void DiagnoseBadConversion(Sema &<br>
DeclarationName Name = cast<OverloadExpr>(E)-><wbr>getName();<br>
<br>
S.Diag(Fn->getLocation(), diag::note_ovl_candidate_bad_<wbr>overload)<br>
- << (unsigned) FnKind << FnDesc<br>
- << (FromExpr ? FromExpr->getSourceRange() : SourceRange())<br>
- << ToTy << Name << I+1;<br>
+ << (unsigned)FnKindPair.first << (unsigned)FnKindPair.second << FnDesc<br>
+ << (FromExpr ? FromExpr->getSourceRange() : SourceRange()) << ToTy<br>
+ << Name << I + 1;<br>
MaybeEmitInheritedConstructorN<wbr>ote(S, Cand->FoundDecl);<br>
return;<br>
}<br>
@@ -9598,43 +9611,40 @@ static void DiagnoseBadConversion(Sema &<br>
<br>
if (FromQs.getAddressSpace() != ToQs.getAddressSpace()) {<br>
S.Diag(Fn->getLocation(), diag::note_ovl_candidate_bad_<wbr>addrspace)<br>
- << (unsigned) FnKind << FnDesc<br>
- << (FromExpr ? FromExpr->getSourceRange() : SourceRange())<br>
- << FromTy<br>
- << FromQs.<wbr>getAddressSpaceAttributePrintV<wbr>alue()<br>
- << ToQs.<wbr>getAddressSpaceAttributePrintV<wbr>alue()<br>
- << (unsigned) isObjectArgument << I+1;<br>
+ << (unsigned)FnKindPair.first << (unsigned)FnKindPair.second << FnDesc<br>
+ << (FromExpr ? FromExpr->getSourceRange() : SourceRange()) << FromTy<br>
+ << FromQs.<wbr>getAddressSpaceAttributePrintV<wbr>alue()<br>
+ << ToQs.<wbr>getAddressSpaceAttributePrintV<wbr>alue()<br>
+ << (unsigned)isObjectArgument << I + 1;<br>
MaybeEmitInheritedConstructorN<wbr>ote(S, Cand->FoundDecl);<br>
return;<br>
}<br>
<br>
if (FromQs.getObjCLifetime() != ToQs.getObjCLifetime()) {<br>
S.Diag(Fn->getLocation(), diag::note_ovl_candidate_bad_<wbr>ownership)<br>
- << (unsigned) FnKind << FnDesc<br>
- << (FromExpr ? FromExpr->getSourceRange() : SourceRange())<br>
- << FromTy<br>
- << FromQs.getObjCLifetime() << ToQs.getObjCLifetime()<br>
- << (unsigned) isObjectArgument << I+1;<br>
+ << (unsigned)FnKindPair.first << (unsigned)FnKindPair.second << FnDesc<br>
+ << (FromExpr ? FromExpr->getSourceRange() : SourceRange()) << FromTy<br>
+ << FromQs.getObjCLifetime() << ToQs.getObjCLifetime()<br>
+ << (unsigned)isObjectArgument << I + 1;<br>
MaybeEmitInheritedConstructorN<wbr>ote(S, Cand->FoundDecl);<br>
return;<br>
}<br>
<br>
if (FromQs.getObjCGCAttr() != ToQs.getObjCGCAttr()) {<br>
S.Diag(Fn->getLocation(), diag::note_ovl_candidate_bad_<wbr>gc)<br>
- << (unsigned) FnKind << FnDesc<br>
- << (FromExpr ? FromExpr->getSourceRange() : SourceRange())<br>
- << FromTy<br>
- << FromQs.getObjCGCAttr() << ToQs.getObjCGCAttr()<br>
- << (unsigned) isObjectArgument << I+1;<br>
+ << (unsigned)FnKindPair.first << (unsigned)FnKindPair.second << FnDesc<br>
+ << (FromExpr ? FromExpr->getSourceRange() : SourceRange()) << FromTy<br>
+ << FromQs.getObjCGCAttr() << ToQs.getObjCGCAttr()<br>
+ << (unsigned)isObjectArgument << I + 1;<br>
MaybeEmitInheritedConstructorN<wbr>ote(S, Cand->FoundDecl);<br>
return;<br>
}<br>
<br>
if (FromQs.hasUnaligned() != ToQs.hasUnaligned()) {<br>
S.Diag(Fn->getLocation(), diag::note_ovl_candidate_bad_<wbr>unaligned)<br>
- << (unsigned) FnKind << FnDesc<br>
- << (FromExpr ? FromExpr->getSourceRange() : SourceRange())<br>
- << FromTy << FromQs.hasUnaligned() << I+1;<br>
+ << (unsigned)FnKindPair.first << (unsigned)FnKindPair.second << FnDesc<br>
+ << (FromExpr ? FromExpr->getSourceRange() : SourceRange()) << FromTy<br>
+ << FromQs.hasUnaligned() << I + 1;<br>
MaybeEmitInheritedConstructorN<wbr>ote(S, Cand->FoundDecl);<br>
return;<br>
}<br>
@@ -9644,14 +9654,14 @@ static void DiagnoseBadConversion(Sema &<br>
<br>
if (isObjectArgument) {<br>
S.Diag(Fn->getLocation(), diag::note_ovl_candidate_bad_<wbr>cvr_this)<br>
- << (unsigned) FnKind << FnDesc<br>
- << (FromExpr ? FromExpr->getSourceRange() : SourceRange())<br>
- << FromTy << (CVR - 1);<br>
+ << (unsigned)FnKindPair.first << (unsigned)FnKindPair.second << FnDesc<br>
+ << (FromExpr ? FromExpr->getSourceRange() : SourceRange()) << FromTy<br>
+ << (CVR - 1);<br>
} else {<br>
S.Diag(Fn->getLocation(), diag::note_ovl_candidate_bad_<wbr>cvr)<br>
- << (unsigned) FnKind << FnDesc<br>
- << (FromExpr ? FromExpr->getSourceRange() : SourceRange())<br>
- << FromTy << (CVR - 1) << I+1;<br>
+ << (unsigned)FnKindPair.first << (unsigned)FnKindPair.second << FnDesc<br>
+ << (FromExpr ? FromExpr->getSourceRange() : SourceRange()) << FromTy<br>
+ << (CVR - 1) << I + 1;<br>
}<br>
MaybeEmitInheritedConstructorN<wbr>ote(S, Cand->FoundDecl);<br>
return;<br>
@@ -9661,9 +9671,9 @@ static void DiagnoseBadConversion(Sema &<br>
// telling the user that it has type void is not useful.<br>
if (FromExpr && isa<InitListExpr>(FromExpr)) {<br>
S.Diag(Fn->getLocation(), diag::note_ovl_candidate_bad_<wbr>list_argument)<br>
- << (unsigned) FnKind << FnDesc<br>
- << (FromExpr ? FromExpr->getSourceRange() : SourceRange())<br>
- << FromTy << ToTy << (unsigned) isObjectArgument << I+1;<br>
+ << (unsigned)FnKindPair.first << (unsigned)FnKindPair.second << FnDesc<br>
+ << (FromExpr ? FromExpr->getSourceRange() : SourceRange()) << FromTy<br>
+ << ToTy << (unsigned)isObjectArgument << I + 1;<br>
MaybeEmitInheritedConstructorN<wbr>ote(S, Cand->FoundDecl);<br>
return;<br>
}<br>
@@ -9677,10 +9687,10 @@ static void DiagnoseBadConversion(Sema &<br>
if (TempFromTy->isIncompleteType(<wbr>)) {<br>
// Emit the generic diagnostic and, optionally, add the hints to it.<br>
S.Diag(Fn->getLocation(), diag::note_ovl_candidate_bad_<wbr>conv_incomplete)<br>
- << (unsigned) FnKind << FnDesc<br>
- << (FromExpr ? FromExpr->getSourceRange() : SourceRange())<br>
- << FromTy << ToTy << (unsigned) isObjectArgument << I+1<br>
- << (unsigned) (Cand->Fix.Kind);<br>
+ << (unsigned)FnKindPair.first << (unsigned)FnKindPair.second << FnDesc<br>
+ << (FromExpr ? FromExpr->getSourceRange() : SourceRange()) << FromTy<br>
+ << ToTy << (unsigned)isObjectArgument << I + 1<br>
+ << (unsigned)(Cand->Fix.Kind);<br>
<br>
MaybeEmitInheritedConstructorN<wbr>ote(S, Cand->FoundDecl);<br>
return;<br>
@@ -9718,21 +9728,19 @@ static void DiagnoseBadConversion(Sema &<br>
ToTy.getNonReferenceType().<wbr>getCanonicalType() ==<br>
FromTy.getNonReferenceType().<wbr>getCanonicalType()) {<br>
S.Diag(Fn->getLocation(), diag::note_ovl_candidate_bad_<wbr>lvalue)<br>
- << (unsigned) FnKind << FnDesc<br>
- << (FromExpr ? FromExpr->getSourceRange() : SourceRange())<br>
- << (unsigned) isObjectArgument << I + 1;<br>
+ << (unsigned)FnKindPair.first << (unsigned)FnKindPair.second << FnDesc<br>
+ << (unsigned)isObjectArgument << I + 1<br>
+ << (FromExpr ? FromExpr->getSourceRange() : SourceRange());<br>
MaybeEmitInheritedConstructorN<wbr>ote(S, Cand->FoundDecl);<br>
return;<br>
}<br>
}<br>
<br>
if (BaseToDerivedConversion) {<br>
- S.Diag(Fn->getLocation(),<br>
- diag::note_ovl_candidate_bad_<wbr>base_to_derived_conv)<br>
- << (unsigned) FnKind << FnDesc<br>
- << (FromExpr ? FromExpr->getSourceRange() : SourceRange())<br>
- << (BaseToDerivedConversion - 1)<br>
- << FromTy << ToTy << I+1;<br>
+ S.Diag(Fn->getLocation(), diag::note_ovl_candidate_bad_<wbr>base_to_derived_conv)<br>
+ << (unsigned)FnKindPair.first << (unsigned)FnKindPair.second << FnDesc<br>
+ << (FromExpr ? FromExpr->getSourceRange() : SourceRange())<br>
+ << (BaseToDerivedConversion - 1) << FromTy << ToTy << I + 1;<br>
MaybeEmitInheritedConstructorN<wbr>ote(S, Cand->FoundDecl);<br>
return;<br>
}<br>
@@ -9743,9 +9751,9 @@ static void DiagnoseBadConversion(Sema &<br>
Qualifiers ToQs = CToTy.getQualifiers();<br>
if (FromQs.getObjCLifetime() != ToQs.getObjCLifetime()) {<br>
S.Diag(Fn->getLocation(), diag::note_ovl_candidate_bad_<wbr>arc_conv)<br>
- << (unsigned) FnKind << FnDesc<br>
- << (FromExpr ? FromExpr->getSourceRange() : SourceRange())<br>
- << FromTy << ToTy << (unsigned) isObjectArgument << I+1;<br>
+ << (unsigned)FnKindPair.first << (unsigned)FnKindPair.second<br>
+ << FnDesc << (FromExpr ? FromExpr->getSourceRange() : SourceRange())<br>
+ << FromTy << ToTy << (unsigned)isObjectArgument << I + 1;<br>
MaybeEmitInheritedConstructorN<wbr>ote(S, Cand->FoundDecl);<br>
return;<br>
}<br>
@@ -9757,10 +9765,10 @@ static void DiagnoseBadConversion(Sema &<br>
<br>
// Emit the generic diagnostic and, optionally, add the hints to it.<br>
PartialDiagnostic FDiag = S.PDiag(diag::note_ovl_<wbr>candidate_bad_conv);<br>
- FDiag << (unsigned) FnKind << FnDesc<br>
- << (FromExpr ? FromExpr->getSourceRange() : SourceRange())<br>
- << FromTy << ToTy << (unsigned) isObjectArgument << I + 1<br>
- << (unsigned) (Cand->Fix.Kind);<br>
+ FDiag << (unsigned)FnKindPair.first << (unsigned)FnKindPair.second << FnDesc<br>
+ << (FromExpr ? FromExpr->getSourceRange() : SourceRange()) << FromTy<br>
+ << ToTy << (unsigned)isObjectArgument << I + 1<br>
+ << (unsigned)(Cand->Fix.Kind);<br>
<br>
// If we can fix the conversion, suggest the FixIts.<br>
for (std::vector<FixItHint>::<wbr>iterator HI = Cand->Fix.Hints.begin(),<br>
@@ -9833,17 +9841,18 @@ static void DiagnoseArityMismatch(Sema &<br>
}<br>
<br>
std::string Description;<br>
- OverloadCandidateKind FnKind =<br>
+ std::pair<<wbr>OverloadCandidateKind, OverloadCandidateSelect> FnKindPair =<br>
ClassifyOverloadCandidate(S, Found, Fn, Description);<br>
<br>
if (modeCount == 1 && Fn->getParamDecl(0)-><wbr>getDeclName())<br>
S.Diag(Fn->getLocation(), diag::note_ovl_candidate_<wbr>arity_one)<br>
- << (unsigned) FnKind << (Fn-><wbr>getDescribedFunctionTemplate() != nullptr)<br>
- << mode << Fn->getParamDecl(0) << NumFormalArgs;<br>
+ << (unsigned)FnKindPair.first << (unsigned)FnKindPair.second<br>
+ << Description << mode << Fn->getParamDecl(0) << NumFormalArgs;<br>
else<br>
S.Diag(Fn->getLocation(), diag::note_ovl_candidate_<wbr>arity)<br>
- << (unsigned) FnKind << (Fn-><wbr>getDescribedFunctionTemplate() != nullptr)<br>
- << mode << modeCount << NumFormalArgs;<br>
+ << (unsigned)FnKindPair.first << (unsigned)FnKindPair.second<br>
+ << Description << mode << modeCount << NumFormalArgs;<br>
+<br>
MaybeEmitInheritedConstructorN<wbr>ote(S, Found);<br>
}<br>
<br>
@@ -10118,11 +10127,13 @@ static void DiagnoseBadTarget(Sema &S, O<br>
CalleeTarget = S.IdentifyCUDATarget(Callee);<br>
<br>
std::string FnDesc;<br>
- OverloadCandidateKind FnKind =<br>
+ std::pair<<wbr>OverloadCandidateKind, OverloadCandidateSelect> FnKindPair =<br>
ClassifyOverloadCandidate(S, Cand->FoundDecl, Callee, FnDesc);<br>
<br>
S.Diag(Callee->getLocation(), diag::note_ovl_candidate_bad_<wbr>target)<br>
- << (unsigned)FnKind << CalleeTarget << CallerTarget;<br>
+ << (unsigned)FnKindPair.first << (unsigned)ocs_non_template<br>
+ << FnDesc /* Ignored */<br>
+ << CalleeTarget << CallerTarget;<br>
<br>
// This could be an implicit constructor for which we could not infer the<br>
// target due to a collsion. Diagnose that case.<br>
@@ -10131,7 +10142,7 @@ static void DiagnoseBadTarget(Sema &S, O<br>
CXXRecordDecl *ParentClass = Meth->getParent();<br>
Sema::CXXSpecialMember CSM;<br>
<br>
- switch (FnKind) {<br>
+ switch (FnKindPair.first) {<br>
default:<br>
return;<br>
case oc_implicit_default_<wbr>constructor:<br>
@@ -10203,12 +10214,12 @@ static void NoteFunctionCandidate(Sema &<br>
if (Cand->Viable) {<br>
if (Fn->isDeleted() || S.<wbr>isFunctionConsideredUnavailabl<wbr>e(Fn)) {<br>
std::string FnDesc;<br>
- OverloadCandidateKind FnKind =<br>
- ClassifyOverloadCandidate(S, Cand->FoundDecl, Fn, FnDesc);<br>
+ std::pair<<wbr>OverloadCandidateKind, OverloadCandidateSelect> FnKindPair =<br>
+ ClassifyOverloadCandidate(S, Cand->FoundDecl, Fn, FnDesc);<br>
<br>
S.Diag(Fn->getLocation(), diag::note_ovl_candidate_<wbr>deleted)<br>
- << FnKind << FnDesc<br>
- << (Fn->isDeleted() ? (Fn->isDeletedAsWritten() ? 1 : 2) : 0);<br>
+ << (unsigned)FnKindPair.first << (unsigned)FnKindPair.second << FnDesc<br>
+ << (Fn->isDeleted() ? (Fn->isDeletedAsWritten() ? 1 : 2) : 0);<br>
MaybeEmitInheritedConstructorN<wbr>ote(S, Cand->FoundDecl);<br>
return;<br>
}<br>
@@ -11102,9 +11113,9 @@ private:<br>
MatchesCopy.begin(), MatchesCopy.end(), FailedCandidates,<br>
SourceExpr->getLocStart(), S.PDiag(),<br>
S.PDiag(diag::err_addr_ovl_<wbr>ambiguous)<br>
- << Matches[0].second-><wbr>getDeclName(),<br>
+ << Matches[0].second-><wbr>getDeclName(),<br>
S.PDiag(diag::note_ovl_<wbr>candidate)<br>
- << (unsigned)oc_function_<wbr>template,<br>
+ << (unsigned)oc_function << (unsigned)ocs_described_<wbr>template,<br>
Complain, TargetFunctionType);<br>
<br>
if (Result != MatchesCopy.end()) {<br>
<br>
Modified: cfe/trunk/test/CXX/drs/dr4xx.<wbr>cpp<br>
URL: <a href="http://llvm.org/viewvc/llvm-project/cfe/trunk/test/CXX/drs/dr4xx.cpp?rev=333485&r1=333484&r2=333485&view=diff" rel="noreferrer" target="_blank">http://llvm.org/viewvc/llvm-<wbr>project/cfe/trunk/test/CXX/<wbr>drs/dr4xx.cpp?rev=333485&r1=<wbr>333484&r2=333485&view=diff</a><br>
==============================<wbr>==============================<wbr>==================<br>
--- cfe/trunk/test/CXX/drs/dr4xx.<wbr>cpp (original)<br>
+++ cfe/trunk/test/CXX/drs/dr4xx.<wbr>cpp Tue May 29 18:00:41 2018<br>
@@ -533,10 +533,10 @@ namespace dr437 { // dr437: sup 1308<br>
<br>
namespace dr444 { // dr444: yes<br>
struct D;<br>
- struct B { // expected-note {{candidate is the implicit copy}} expected-note 0-1 {{implicit move}}<br>
+ struct B { // expected-note {{candidate function (the implicit copy}} expected-note 0-1 {{implicit move}}<br>
D &operator=(D &) = delete; // expected-error 0-1{{extension}} expected-note {{deleted}}<br>
};<br>
- struct D : B { // expected-note {{candidate is the implicit}} expected-note 0-1 {{implicit move}}<br>
+ struct D : B { // expected-note {{candidate function (the implicit copy}} expected-note 0-1 {{implicit move}}<br>
using B::operator=;<br>
} extern d;<br>
void f() {<br>
<br>
Modified: cfe/trunk/test/CXX/special/<wbr>class.inhctor/p1.cpp<br>
URL: <a href="http://llvm.org/viewvc/llvm-project/cfe/trunk/test/CXX/special/class.inhctor/p1.cpp?rev=333485&r1=333484&r2=333485&view=diff" rel="noreferrer" target="_blank">http://llvm.org/viewvc/llvm-<wbr>project/cfe/trunk/test/CXX/<wbr>special/class.inhctor/p1.cpp?<wbr>rev=333485&r1=333484&r2=<wbr>333485&view=diff</a><br>
==============================<wbr>==============================<wbr>==================<br>
--- cfe/trunk/test/CXX/special/<wbr>class.inhctor/p1.cpp (original)<br>
+++ cfe/trunk/test/CXX/special/<wbr>class.inhctor/p1.cpp Tue May 29 18:00:41 2018<br>
@@ -3,7 +3,7 @@<br>
// Note: [class.inhctor] was removed by P0136R1. This tests the new behavior<br>
// for the wording that used to be there.<br>
<br>
-struct A { // expected-note 4{{candidate is the implicit}}<br>
+struct A { // expected-note 4{{candidate constructor (the implicit}}<br>
A(...); // expected-note 4{{candidate constructor}} expected-note 4{{candidate inherited constructor}}<br>
A(int = 0, int = 0, int = 0, int = 0, ...); // expected-note 3{{candidate constructor}} expected-note 3{{candidate inherited constructor}}<br>
A(int = 0, int = 0, ...); // expected-note 3{{candidate constructor}} expected-note 3{{candidate inherited constructor}}<br>
@@ -14,7 +14,7 @@ struct A { // expected-note 4{{candidate<br>
template<typename T, int N> A(const T (&)[N], int = 0); // expected-note {{candidate constructor}} expected-note {{candidate inherited constructor}}<br>
};<br>
<br>
-struct B : A { // expected-note 4{{candidate is the implicit}}<br>
+struct B : A { // expected-note 4{{candidate constructor (the implicit}}<br>
using A::A; // expected-note 15{{inherited here}}<br>
B(void*);<br>
};<br>
<br>
Modified: cfe/trunk/test/SemaCXX/attr-<wbr>noreturn.cpp<br>
URL: <a href="http://llvm.org/viewvc/llvm-project/cfe/trunk/test/SemaCXX/attr-noreturn.cpp?rev=333485&r1=333484&r2=333485&view=diff" rel="noreferrer" target="_blank">http://llvm.org/viewvc/llvm-<wbr>project/cfe/trunk/test/<wbr>SemaCXX/attr-noreturn.cpp?rev=<wbr>333485&r1=333484&r2=333485&<wbr>view=diff</a><br>
==============================<wbr>==============================<wbr>==================<br>
--- cfe/trunk/test/SemaCXX/attr-<wbr>noreturn.cpp (original)<br>
+++ cfe/trunk/test/SemaCXX/attr-<wbr>noreturn.cpp Tue May 29 18:00:41 2018<br>
@@ -244,11 +244,11 @@ namespace PR15291 {<br>
template <typename T><br>
void qux(T) {}<br>
<br>
- // expected-note@+5 {{candidate function not viable: no overload of 'baz' matching 'void (*)(int) __attribute__((noreturn))' for 1st argument}}<br>
- // expected-note@+4 {{candidate function not viable: no overload of 'qux' matching 'void (*)(int) __attribute__((noreturn))' for 1st argument}}<br>
- // expected-note@+3 {{candidate function not viable: no overload of 'bar' matching 'void (*)(int) __attribute__((noreturn))' for 1st argument}}<br>
- // expected-note@+2 {{candidate function not viable: no overload of 'bar' matching 'void (*)(int)' for 1st argument}}<br>
- // expected-note@+1 {{candidate function not viable: no overload of 'bar' matching 'void (*)(int)' for 1st argument}}<br>
+ // expected-note@+5 {{candidate function template not viable: no overload of 'baz' matching 'void (*)(int) __attribute__((noreturn))' for 1st argument}}<br>
+ // expected-note@+4 {{candidate function template not viable: no overload of 'qux' matching 'void (*)(int) __attribute__((noreturn))' for 1st argument}}<br>
+ // expected-note@+3 {{candidate function template not viable: no overload of 'bar' matching 'void (*)(int) __attribute__((noreturn))' for 1st argument}}<br>
+ // expected-note@+2 {{candidate function template not viable: no overload of 'bar' matching 'void (*)(int)' for 1st argument}}<br>
+ // expected-note@+1 {{candidate function template not viable: no overload of 'bar' matching 'void (*)(int)' for 1st argument}}<br>
template <typename T> void accept_T(T) {}<br>
<br>
// expected-note@+1 {{candidate function not viable: no overload of 'bar' matching 'void (*)(int)' for 1st argument}}<br>
<br>
Modified: cfe/trunk/test/SemaCXX/cxx1y-<wbr>generic-lambdas.cpp<br>
URL: <a href="http://llvm.org/viewvc/llvm-project/cfe/trunk/test/SemaCXX/cxx1y-generic-lambdas.cpp?rev=333485&r1=333484&r2=333485&view=diff" rel="noreferrer" target="_blank">http://llvm.org/viewvc/llvm-<wbr>project/cfe/trunk/test/<wbr>SemaCXX/cxx1y-generic-lambdas.<wbr>cpp?rev=333485&r1=333484&r2=<wbr>333485&view=diff</a><br>
==============================<wbr>==============================<wbr>==================<br>
--- cfe/trunk/test/SemaCXX/cxx1y-<wbr>generic-lambdas.cpp (original)<br>
+++ cfe/trunk/test/SemaCXX/cxx1y-<wbr>generic-lambdas.cpp Tue May 29 18:00:41 2018<br>
@@ -181,7 +181,7 @@ int test() {<br>
int (*fp2)(int) = [](auto b) -> int { return b; };<br>
int (*fp3)(char) = [](auto c) -> int { return c; };<br>
char (*fp4)(int) = [](auto d) { return d; }; //expected-error{{no viable conversion}}\<br>
- //expected-note{{candidate function[with $0 = int]}}<br>
+ //expected-note{{candidate function [with $0 = int]}}<br>
char (*fp5)(char) = [](auto e) -> int { return e; }; //expected-error{{no viable conversion}}\<br>
//expected-note{{candidate template ignored}}<br>
<br>
<br>
Modified: cfe/trunk/test/SemaCXX/<wbr>overload-call.cpp<br>
URL: <a href="http://llvm.org/viewvc/llvm-project/cfe/trunk/test/SemaCXX/overload-call.cpp?rev=333485&r1=333484&r2=333485&view=diff" rel="noreferrer" target="_blank">http://llvm.org/viewvc/llvm-<wbr>project/cfe/trunk/test/<wbr>SemaCXX/overload-call.cpp?rev=<wbr>333485&r1=333484&r2=333485&<wbr>view=diff</a><br>
==============================<wbr>==============================<wbr>==================<br>
--- cfe/trunk/test/SemaCXX/<wbr>overload-call.cpp (original)<br>
+++ cfe/trunk/test/SemaCXX/<wbr>overload-call.cpp Tue May 29 18:00:41 2018<br>
@@ -338,22 +338,23 @@ namespace PR5756 {<br>
<br>
// Tests the exact text used to note the candidates<br>
namespace test1 {<br>
- template <class T> void foo(T t, unsigned N); // expected-note {{candidate function not viable: no known conversion from 'const char [6]' to 'unsigned int' for 2nd argument}}<br>
- void foo(int n, char N); // expected-note {{candidate function not viable: no known conversion from 'const char [6]' to 'char' for 2nd argument}} <br>
- void foo(int n, const char *s, int t); // expected-note {{candidate function not viable: requires 3 arguments, but 2 were provided}}<br>
- void foo(int n, const char *s, int t, ...); // expected-note {{candidate function not viable: requires at least 3 arguments, but 2 were provided}}<br>
- void foo(int n, const char *s, int t, int u = 0); // expected-note {{candidate function not viable: requires at least 3 arguments, but 2 were provided}}<br>
+template <class T><br>
+void foo(T t, unsigned N); // expected-note {{candidate function template not viable: no known conversion from 'const char [6]' to 'unsigned int' for 2nd argument}}<br>
+void foo(int n, char N); // expected-note {{candidate function not viable: no known conversion from 'const char [6]' to 'char' for 2nd argument}}<br>
+void foo(int n, const char *s, int t); // expected-note {{candidate function not viable: requires 3 arguments, but 2 were provided}}<br>
+void foo(int n, const char *s, int t, ...); // expected-note {{candidate function not viable: requires at least 3 arguments, but 2 were provided}}<br>
+void foo(int n, const char *s, int t, int u = 0); // expected-note {{candidate function not viable: requires at least 3 arguments, but 2 were provided}}<br>
<br>
- // PR 11857<br>
- void foo(int n); // expected-note {{candidate function not viable: requires single argument 'n', but 2 arguments were provided}}<br>
- void foo(unsigned n = 10); // expected-note {{candidate function not viable: allows at most single argument 'n', but 2 arguments were provided}}<br>
- void bar(int n, int u = 0); // expected-note {{candidate function not viable: requires at least argument 'n', but no arguments were provided}}<br>
- void baz(int n = 0, int u = 0); // expected-note {{candidate function not viable: requires at most 2 arguments, but 3 were provided}}<br>
+// PR 11857<br>
+void foo(int n); // expected-note {{candidate function not viable: requires single argument 'n', but 2 arguments were provided}}<br>
+void foo(unsigned n = 10); // expected-note {{candidate function not viable: allows at most single argument 'n', but 2 arguments were provided}}<br>
+void bar(int n, int u = 0); // expected-note {{candidate function not viable: requires at least argument 'n', but no arguments were provided}}<br>
+void baz(int n = 0, int u = 0); // expected-note {{candidate function not viable: requires at most 2 arguments, but 3 were provided}}<br>
<br>
- void test() {<br>
- foo(4, "hello"); //expected-error {{no matching function for call to 'foo'}}<br>
- bar(); //expected-error {{no matching function for call to 'bar'}}<br>
- baz(3, 4, 5); // expected-error {{no matching function for call to 'baz'}}<br>
+void test() {<br>
+ foo(4, "hello"); //expected-error {{no matching function for call to 'foo'}}<br>
+ bar(); //expected-error {{no matching function for call to 'bar'}}<br>
+ baz(3, 4, 5); // expected-error {{no matching function for call to 'baz'}}<br>
}<br>
}<br>
<br>
<br>
Modified: cfe/trunk/test/SemaCXX/<wbr>overload-member-call.cpp<br>
URL: <a href="http://llvm.org/viewvc/llvm-project/cfe/trunk/test/SemaCXX/overload-member-call.cpp?rev=333485&r1=333484&r2=333485&view=diff" rel="noreferrer" target="_blank">http://llvm.org/viewvc/llvm-<wbr>project/cfe/trunk/test/<wbr>SemaCXX/overload-member-call.<wbr>cpp?rev=333485&r1=333484&r2=<wbr>333485&view=diff</a><br>
==============================<wbr>==============================<wbr>==================<br>
--- cfe/trunk/test/SemaCXX/<wbr>overload-member-call.cpp (original)<br>
+++ cfe/trunk/test/SemaCXX/<wbr>overload-member-call.cpp Tue May 29 18:00:41 2018<br>
@@ -70,7 +70,8 @@ void test_X2(X2 *x2p, const X2 *cx2p) {<br>
// Tests the exact text used to note the candidates<br>
namespace test1 {<br>
class A {<br>
- template <class T> void foo(T t, unsigned N); // expected-note {{candidate function not viable: no known conversion from 'const char [6]' to 'unsigned int' for 2nd argument}}<br>
+ template <class T><br>
+ void foo(T t, unsigned N); // expected-note {{candidate function template not viable: no known conversion from 'const char [6]' to 'unsigned int' for 2nd argument}}<br>
void foo(int n, char N); // expected-note {{candidate function not viable: no known conversion from 'const char [6]' to 'char' for 2nd argument}} <br>
void foo(int n, const char *s, int t); // expected-note {{candidate function not viable: requires 3 arguments, but 2 were provided}}<br>
void foo(int n, const char *s, int t, ...); // expected-note {{candidate function not viable: requires at least 3 arguments, but 2 were provided}}<br>
<br>
<br>
______________________________<wbr>_________________<br>
cfe-commits mailing list<br>
<a href="mailto:cfe-commits@lists.llvm.org">cfe-commits@lists.llvm.org</a><br>
<a href="http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits" rel="noreferrer" target="_blank">http://lists.llvm.org/cgi-bin/<wbr>mailman/listinfo/cfe-commits</a><br>
</blockquote></div><br></div>