Well, we already have the "no-warning" convention for that. With the current behavior of -verify, that behaves as intended. But I can see how someone writing a NEW test would be inclined to just put "// expected-no-diagnostics" at the top of the file and not mark any particular lines, and if said test was later converted over to include some expected warnings...well, the original "potentially-warning" lines would never be annotated.
But neither -Werror nor expected-no-diagnostics changes this existing behavior, so maybe it doesn't matter. Jordan On Sep 30, 2012, at 14:53 , Sean Silva <[email protected]> wrote: > 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 <[email protected]> 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 >> >> >> _______________________________________________ cfe-commits mailing list [email protected] http://lists.cs.uiuc.edu/mailman/listinfo/cfe-commits
