https://gcc.gnu.org/bugzilla/show_bug.cgi?id=113760

kab at acm dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |kab at acm dot org

--- Comment #5 from kab at acm dot org ---
(In reply to Andrew Pinski from comment #3)
> From JDK bug report:
> > It looks like it only removed
> > the warnings for empty declarations at namespace scope. I couldn't find
> > anything for other cases, including empty class member declarations.
> 
> Yes because the C++ defect report was only for `Spurious semicolons at
> namespace scope should be allowed`.  See
> https://www.open-std.org/jtc1/sc22/wg21/docs/cwg_defects.html#569 .
> 
> 
> ```
> struct f
> {
>   int t;  ;
> };
> ```
> 
> Is not allowed by the C++ standard currently and is a GCC extension, maybe
> it should have a seperate flag to control that but I am not 100% sure.

It's C++14 that the openjdk currently cares about. C++14 added
"empty-declaration" to the syntax for "member-declaration".
C++14 9.2 [class.mem]
https://www.open-std.org/jtc1/sc22/wg21/docs/cwg_defects.html#1693

The above "struct f" declaration warns with C++14 and -Wpedantic, but
shouldn't.

Tested with that struct as the only contents of "test.cpp" and this command
line for g++13.2.0:
g++ -c -Wpedantic -std=c++14 -o test.o test.cpp

Reply via email to