[C++ PATCH] PR c++/90590 Suppress warning for enumeration value not handled in switch warning

Marek Polacek polacek@redhat.com
Tue Jul 9 17:48:00 GMT 2019


On Tue, Jul 09, 2019 at 11:18:53AM -0400, Matthew Beliveau wrote:
> index 00000000000..8aa65cf0afd
> --- /dev/null
> +++ gcc/testsuite/c-c++-common/pr90590-2.c
> @@ -0,0 +1,8 @@
> +#include "pr90590-2.h"
> +
> +void
> +fn ()
> +{
> +  switch (c.b) // { dg-bogus "enumeration value" }
> +    ;
> +}

I suppose this test should also have
// PR c++/90590
// { dg-options -Wswitch }
because without -Wswitch the warning wouldn't trigger in any case.

Marek



More information about the Gcc-patches mailing list