+2011-10-09 Magnus Fromreide <magfr@lysator.liu.se>
+
+ * parser.c (cp_parser_enumerator_list): Do not warn about
+ trailing commas in C++0x mode.
+
2011-11-04 Olivier Goffart <olivier@woboq.com>
Jason Merrill <jason@redhat.com>
enum-specifier:
enum-head { enumerator-list [opt] }
+ enum-head { enumerator-list , } [C++0x]
enum-head:
enum-key identifier [opt] enum-base [opt]
GNU Extensions:
enum-key attributes[opt] identifier [opt] enum-base [opt]
{ enumerator-list [opt] }attributes[opt]
+ enum-key attributes[opt] identifier [opt] enum-base [opt]
+ { enumerator-list, }attributes[opt] [C++0x]
Returns an ENUM_TYPE representing the enumeration, or NULL_TREE
if the token stream isn't an enum-specifier after all. */
/* If the next token is a `}', there is a trailing comma. */
if (cp_lexer_next_token_is (parser->lexer, CPP_CLOSE_BRACE))
{
- if (!in_system_header)
- pedwarn (input_location, OPT_pedantic, "comma at end of enumerator list");
+ if (cxx_dialect < cxx0x && !in_system_header)
+ pedwarn (input_location, OPT_pedantic,
+ "comma at end of enumerator list");
break;
}
}
+2011-10-09 Magnus Fromreide <magfr@lysator.liu.se>
+
+ * g++.dg/cpp0x/enum21a.C: Test that enum x { y, } does
+ generate a pedwarn in c++98-mode.
+ * g++.dg/cpp0x/enum21b.C: Test that enum x { y, }
+ don't generate a pedwarn in c++0x-mode.
+
2011-11-04 Olivier Goffart <olivier@woboq.com>
PR c++/50965