<div dir="ltr">Since this is just a wording change, presumably the diagnostic is already tested in an existing file - perhaps you could exetendi that test to cover this functionality (we try not to add new test files too much - better to test functionality once/in one place as much as possible (both for ease of reading/updating/understanding the test suite, and for speed of execution (process startup time makes up a significant portion of the test execution time, so reducing the total number of test files/commands is useful there)))</div><div class="gmail_extra"><br><div class="gmail_quote">On Sat, Feb 13, 2016 at 8:32 PM, Ryan Yee 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">ryee88 updated this revision to Diff 47925.<br>
ryee88 added a comment.<br>
<br>
Sorry-- re-uploading the diff. Didn't notice I dropped the code changes.<br>
<span class="im HOEnZb"><br>
<br>
<a href="http://reviews.llvm.org/D16949" rel="noreferrer" target="_blank">http://reviews.llvm.org/D16949</a><br>
<br>
Files:<br>
  include/clang/Basic/DiagnosticSemaKinds.td<br>
  lib/Sema/SemaOverload.cpp<br>
</span><span class="im HOEnZb">  test/Parser/overloaded-pointer-vs-reference-hint.cpp<br>
<br>
Index: test/Parser/overloaded-pointer-vs-reference-hint.cpp<br>
===================================================================<br>
--- /dev/null<br>
+++ test/Parser/overloaded-pointer-vs-reference-hint.cpp<br>
@@ -0,0 +1,15 @@<br>
+// RUN: %clang_cc1 %s -fsyntax-only -verify<br>
+<br>
+class A;<br>
+<br>
+void f0(A *a); // expected-note {{candidate function not viable: cannot convert argument of incomplete type 'A' to 'A *' for 1st argument; take the address of the argument with &}}<br>
+void f1(A &a) {<br>
+  f0(a); // expected-error {{no matching function for call to 'f0'}}<br>
+}<br>
+<br>
+void f2(A &a); // expected-note {{candidate function not viable: cannot convert argument of incomplete type 'A *' to 'A &' for 1st argument; dereference the argument with *}}<br>
+void f3(A *a) {<br>
+  f2(a); // expected-error {{no matching function for call to 'f2'}}<br>
+}<br>
+<br>
+<br>
</span><div class="HOEnZb"><div class="h5">Index: lib/Sema/SemaOverload.cpp<br>
===================================================================<br>
--- lib/Sema/SemaOverload.cpp<br>
+++ lib/Sema/SemaOverload.cpp<br>
@@ -9104,10 +9104,13 @@<br>
   if (const PointerType *PTy = TempFromTy->getAs<PointerType>())<br>
     TempFromTy = PTy->getPointeeType();<br>
   if (TempFromTy->isIncompleteType()) {<br>
+    // Emit the generic diagnostic and, optionally, add the hints to it.<br>
     S.Diag(Fn->getLocation(), diag::note_ovl_candidate_bad_conv_incomplete)<br>
       << (unsigned) FnKind << FnDesc<br>
       << (FromExpr ? FromExpr->getSourceRange() : SourceRange())<br>
-      << FromTy << ToTy << (unsigned) isObjectArgument << I+1;<br>
+      << FromTy << ToTy << (unsigned) isObjectArgument << I+1<br>
+      << (unsigned) (Cand->Fix.Kind);<br>
+<br>
     MaybeEmitInheritedConstructorNote(S, Fn);<br>
     return;<br>
   }<br>
Index: include/clang/Basic/DiagnosticSemaKinds.td<br>
===================================================================<br>
--- include/clang/Basic/DiagnosticSemaKinds.td<br>
+++ include/clang/Basic/DiagnosticSemaKinds.td<br>
@@ -3189,7 +3189,12 @@<br>
     "function (the implicit move assignment operator)|"<br>
     "constructor (inherited)}0%1 "<br>
     "not viable: cannot convert argument of incomplete type "<br>
-    "%diff{$ to $|to parameter type}2,3">;<br>
+    "%diff{$ to $|to parameter type}2,3 for "<br>
+    "%select{%ordinal5 argument|object argument}4"<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_argument : Note<"candidate "<br>
     "%select{function|function|constructor|"<br>
     "function |function |constructor |"<br>
<br>
<br>
</div></div><br>_______________________________________________<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/mailman/listinfo/cfe-commits</a><br>
<br></blockquote></div><br></div>