[cfe-commits] r164677 -

Sean Silva silvas at purdue.edu
Mon Oct 1 20:08:48 PDT 2012


> -verify is already a negative check (it fails if any unexpected
> diagnostics are produced) so I'm not sure what this
> expected-no-diagnostics you are thinking of would do? Would you have to
> put it on every line of code? Would it be entirely optional? If so,
> what purpose would it serve compared to just a pure (non processed)
> comment to the reader?

Oh yeah... I've only ever "consciously" used -verify in the positive
sense (asserting that a diagnostic would be there). I guess my mind's
eye wasn't looking at the "negative space" of the other check, which
is the implicit "no other diagnostics than the expected ones".

--Sean Silva

On Mon, Oct 1, 2012 at 7:34 PM, David Blaikie <dblaikie at gmail.com> wrote:
> -verify is already a negative check (it fails if any unexpected
> diagnostics are produced) so I'm not sure what this
> expected-no-diagnostics you are thinking of would do? Would you have to
> put it on every line of code? Would it be entirely optional? If so,
> what purpose would it serve compared to just a pure (non processed)
> comment to the reader?
> From: Sean Silva
> Sent: 10/1/2012 12:53 AM
> To: Andy Gibbs
> Cc: David Blaikie; Jordan Rose; Nico Weber; Richard Smith;
> cfe-commits at cs.uiuc.edu
> Subject: Re: [cfe-commits] r164677 -
> Oh, I was imagining the expected-no-diagnostics to be localized. So
> that you could e.g. do
>
> int foo(); // expected-no-diagnostics
>
> int bar(cause_an_error<T>); // expected-error [...]
>
> That way, you could, in the same file, assert both for the existence
> of diagnostics for certain code and that no diagnostics are emitted
> for other code.
>
> For me the major downside of -Werror is that it is completely global,
> so that it's not possible to see exactly what the test is expecting to
> not emit diagnostics for.
>
> --Sean Silva
>
> On Sun, Sep 30, 2012 at 3:51 PM, Andy Gibbs <andyg1001 at hotmail.co.uk> wrote:
>> On Sunday, September 30, 2012 4:47 PM, David Blaikie wrote:
>>>
>>> Any particular reason you prefer this (adding a new expect feature)
>>> over just using -Werror (without -verify at all) for tests that are
>>> intended not to produce any diagnostics?
>>>
>>> I don't mind really, just seems like unnecessary work to me & I'm
>>> wondering if I'm missing something
>>
>>
>> Actually, its not actually much difference in terms of work.  The change
>> required to VerifyDiagnosticConsumer is in the range of 15 lines (approx!),
>> but then there are changes to all the test-cases to either change -verify to
>> -Werror or add the line "// expected-no-diagnostics".  This is the major
>> work since there are in the region of 550 tests to which this applies.  I've
>> already made the alterations to VerifyDiagnosticConsumer and to most of the
>> test-cases, i.e. to all but a handful which didn't match the criteria of my
>> automated script, and which I will adjust by hand.
>>
>> Personally, I think it is a good change to make since it adds a useful
>> function (i.e. to check explicitly for no diagnostics), makes test-cases
>> using -verify more fool-proof, and is IMHO better than using -Werror instead
>> since this requires people to remember to use this instead.
>>
>> Cheers
>> Andy
>>
>>
>>



More information about the cfe-commits mailing list