diff options
author | Magnus Fromreide <magfr@lysator.liu.se> | 2011-11-04 18:38:16 +0100 |
---|---|---|
committer | Jason Merrill <jason@gcc.gnu.org> | 2011-11-04 13:38:16 -0400 |
commit | 669cc68c376f9caa8ed5ab7f62bc757fa8d096cb (patch) | |
tree | afe596a657cc518691b0193742d1e900f478c812 /gcc/cp | |
parent | a5c037e263621253d04132f3a7a42f0b1683e004 (diff) | |
download | gcc-669cc68c376f9caa8ed5ab7f62bc757fa8d096cb.zip gcc-669cc68c376f9caa8ed5ab7f62bc757fa8d096cb.tar.gz gcc-669cc68c376f9caa8ed5ab7f62bc757fa8d096cb.tar.bz2 |
parser.c (cp_parser_enumerator_list): Do not warn about trailing commas in C++0x mode.
* parser.c (cp_parser_enumerator_list): Do not warn about
trailing commas in C++0x mode.
From-SVN: r180967
Diffstat (limited to 'gcc/cp')
-rw-r--r-- | gcc/cp/ChangeLog | 5 | ||||
-rw-r--r-- | gcc/cp/parser.c | 8 |
2 files changed, 11 insertions, 2 deletions
diff --git a/gcc/cp/ChangeLog b/gcc/cp/ChangeLog index 27c8b70..f984056 100644 --- a/gcc/cp/ChangeLog +++ b/gcc/cp/ChangeLog @@ -1,3 +1,8 @@ +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> diff --git a/gcc/cp/parser.c b/gcc/cp/parser.c index 811b2fa..2798eb7 100644 --- a/gcc/cp/parser.c +++ b/gcc/cp/parser.c @@ -14058,6 +14058,7 @@ cp_parser_elaborated_type_specifier (cp_parser* parser, enum-specifier: enum-head { enumerator-list [opt] } + enum-head { enumerator-list , } [C++0x] enum-head: enum-key identifier [opt] enum-base [opt] @@ -14077,6 +14078,8 @@ cp_parser_elaborated_type_specifier (cp_parser* parser, 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. */ @@ -14416,8 +14419,9 @@ cp_parser_enumerator_list (cp_parser* parser, tree type) /* 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; } } |