[Bug c++/33750] initialization of non-integral member constant not rejected
rguenth at gcc dot gnu dot org
gcc-bugzilla@gcc.gnu.org
Fri Oct 12 14:45:00 GMT 2007
------- Comment #3 from rguenth at gcc dot gnu dot org 2007-10-12 14:45 -------
>From diagnostic.c:
/* A "pedantic" warning: issues a warning unless -pedantic-errors was
given on the command line, in which case it issues an error. Use
this for diagnostics required by the relevant language standard,
if you have chosen not to make them errors.
Note that these diagnostics are issued independent of the setting
of the -pedantic command-line switch. To get a warning enabled
only with that switch, write "if (pedantic) pedwarn (...);" */
void
pedwarn (const char *gmsgid, ...)
{
But from c-opts.c:
/* Adjust various flags for C++ based on command-line settings. */
if (c_dialect_cxx ())
{
if (!flag_permissive)
{
flag_pedantic_errors = 1;
cpp_opts->pedantic_errors = 1;
}
the first error message is always an error:
static bool
cp_parser_non_integral_constant_expression (cp_parser *parser,
const char *thing)
{
parser->non_integral_constant_expression_p = true;
if (parser->integral_constant_expression_p)
{
if (!parser->allow_non_integral_constant_expression_p)
{
error ("%s cannot appear in a constant-expression", thing);
return true;
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=33750
More information about the Gcc-bugs
mailing list