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

Chandler Carruth via cfe-commits cfe-commits at lists.llvm.org
Fri Dec 23 00:41:53 PST 2016


On Fri, Dec 23, 2016 at 12:32 AM Richard Smith via cfe-commits <
cfe-commits at lists.llvm.org> wrote:

> On 22 Dec 2016 9:32 pm, "Chandler Carruth via cfe-commits" <
> cfe-commits at lists.llvm.org> wrote:
>
> 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?
>
>
> Both tests changed in this commit produce this diagnostic. We don't have
> coverage for the tree-format diagnostic here, though; is that what you're
> referring to?
>

I mean, it is possible I messed something up, but i put a bunch of garbage
text into the message and all tests passed.

And I put an extra '|' into other messages with %diff and tests assert
failed. I don't think they were doing tree-format anything.

But the diagnostic I changed here passed even with my added assert....
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20161223/40cc6f25/attachment-0001.html>


More information about the cfe-commits mailing list