r290399 - When merging two deduced non-type template arguments for the same parameter,

Chandler Carruth via cfe-commits cfe-commits at lists.llvm.org
Thu Dec 22 21:32:31 PST 2016


On Thu, Dec 22, 2016 at 5:41 PM Richard Smith via cfe-commits <
cfe-commits at lists.llvm.org> wrote:

>
> ==============================================================================
> --- cfe/trunk/include/clang/Basic/DiagnosticSemaKinds.td (original)
> +++ cfe/trunk/include/clang/Basic/DiagnosticSemaKinds.td Thu Dec 22
> 19:30:39 2016
> @@ -3343,6 +3343,10 @@ def note_ovl_candidate_incomplete_deduct
>  def note_ovl_candidate_inconsistent_deduction : Note<
>      "candidate template ignored: deduced conflicting
> %select{types|values|"
>      "templates}0 for parameter %1%diff{ ($ vs. $)|}2,3">;
> +def note_ovl_candidate_inconsistent_deduction_types : Note<
> +    "candidate template ignored: deduced values %diff{"
> +    "of conflicting types for parameter %0 (%1 of type $ vs. %3 of type
> $)|"
> +    "%1 and %3 of conflicting types for parameter %0|}2,4">;
>

So, this new diagnostic isn't actually covered by any test. Not just is the
wording not covered, literally it isn't emitted. There is a bug in the
format that we didn't defend against -- having too many '|'s in the %diff
alternatives. I added an assert to try to catch this in r290417 and it
didn't trigger here because we never process this format.

Could you add a test covering this?

I went ahead and fixed the %diff format syntax by inspection in r290417.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20161223/e514beaf/attachment.html>


More information about the cfe-commits mailing list