OK.

On Tue, Aug 2, 2016 at 2:44 PM, Martin Sebor <mse...@gmail.com> wrote:
> My recently committed patch for c++/60760 triggered test suite
> failures in ILP32 mode due to a couple of problems:
>
> 1) The test assumed that (void*)1 will appear in GCC diagnostics
>    as 1ul, which is correct in LP64 but not in ILP32.
> 2) GCC is inconsistent in how it spells "constant expression."
>    Some errors in the C++ front end hyphenate the words while
>    others don't.  Depending on which one happens to get triggered
>    a test that assumes one or the other will fail.  Some test work
>    around this inconsistency by using the regex period expression
>    instead of the space but they aren't consistent about it either.
>
> The attached patch corrects (1), and partially also (2) for errors
> emitted from cp/constexpr.c.  There are still more places in the
> C++ front end that use the hyphenation that should be adjusted
> but I leave that for a follow-on patch.  I chose the spelling
> without the hyphen because it's the dominant form in GCC (32 vs
> 26 diagnostics) and also for consistency with the C front end
> and with other C++ compilers.
>
> While fixing (2) I spent quite a bit of time wrestling with the
> overflow-warn-1.C tests that started failing after the removal
> of the hyphen for no apparent reason.  For some reason I don't
> fully understand, the following test fails in the g++.dg/warn/ directory but
> passes when the order of the dg-error directives
> is reversed.  My guess is that it has something to do with
> the second one being a strict subset of the first and so maybe
> when DejaGnu processes the first one it removes the errors
> matching the second as well and then fails on the second
> directive.
>
> I mention it because it seems like a gotcha worth knowing about
> when writing these types of multi-diagnostic directives.
>
> void f ()
> {
>   switch (0)
>     case 1 / 0: ;   // { dg-warning "division by zero" }
> }
>
> // { dg-error "not a constant" "#1" { target *-*-*-* } 4 }
> // { dg-error "division by zero is not a constant.expression" "#2" { target
> c++11 } 4 }
>
> Martin

Reply via email to