aaron.ballman added a comment.

In D154688#4499797 <https://reviews.llvm.org/D154688#4499797>, @tbaeder wrote:

> In D154688#4498398 <https://reviews.llvm.org/D154688#4498398>, @aaron.ballman 
> wrote:
>
>> In D154688#4497967 <https://reviews.llvm.org/D154688#4497967>, @tbaeder 
>> wrote:
>>
>>> When passing a different prefix via `-verify=foo`, the error messages now 
>>> say "error: 'foo-error' diagnostics seen but not expected", etc.
>>>
>>> I'm often working in test files where two different prefixes are used and 
>>> I'm always confused about which one of the two the error messages are 
>>> talking about.
>>
>> What I'm confused by is that we list the line numbers of the failures, so 
>> the prefix only seems like it's helpful in a case where two prefixes use the 
>> same message and the same severity on the same line. e.g., `// foo-error 
>> {{whatever}} bar-error {{whatever}}`. In the other cases, either the line 
>> number is different, or the severity is different, or the message is 
>> different which I thought was giving sufficient context.
>
> This is also reported as being on line 4:
>
>   // RUN: %clang_cc1 -fsyntax-only -fdiagnostics-print-source-range-info 
> -verify=bar %s 2>&1
>   
>   
>   static_assert(true); // foo \
>                        // bar-error {{failed}}
>
> which is also the case if line 4 contained another `foo-error {{failed}}` 
> which didn't trigger, leaving developers wondering which one it is.

Okay, we do that often enough in our tests (along with two diagnostics on the 
same line directly) that this seems pretty reasonable to me.

Can you add some test coverage where the prefix is not the default `expected`?


CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D154688/new/

https://reviews.llvm.org/D154688

_______________________________________________
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to