diff options
author | Marek Polacek <polacek@redhat.com> | 2022-04-28 16:50:06 -0400 |
---|---|---|
committer | Marek Polacek <polacek@redhat.com> | 2022-04-29 15:07:57 -0400 |
commit | fd0d3e9121c5aa65150d242676be6bbdc8d4a92a (patch) | |
tree | 12f441f0f0de04633a08e1d00e26d6988b6c19a0 /gcc/cp/lambda.cc | |
parent | 8d0fcf135857869f7cff36d29bc3527c482372a9 (diff) | |
download | gcc-fd0d3e9121c5aa65150d242676be6bbdc8d4a92a.zip gcc-fd0d3e9121c5aa65150d242676be6bbdc8d4a92a.tar.gz gcc-fd0d3e9121c5aa65150d242676be6bbdc8d4a92a.tar.bz2 |
c++: pedwarn for empty unnamed enum in decl [PR67048]
[dcl.dcl]/5 says that
enum { };
is ill-formed, and since r197742 we issue a pedwarn. However, the
pedwarn also fires for
enum { } x;
which is well-formed. So only warn when {} is followed by a ;. This
should be correct since you can't have "enum {}, <whatever>" -- that
produces "expected unqualified-id before ',' token".
PR c++/67048
gcc/cp/ChangeLog:
* parser.cc (cp_parser_enum_specifier): Warn about empty unnamed enum
only when it's followed by a semicolon.
gcc/testsuite/ChangeLog:
* g++.dg/cpp0x/enum42.C: New test.
Diffstat (limited to 'gcc/cp/lambda.cc')
0 files changed, 0 insertions, 0 deletions