[Bug c++/96068] Extra semicolon outside of a function should be allowed after c++11?

jakub at gcc dot gnu.org gcc-bugzilla@gcc.gnu.org
Mon May 9 16:19:01 GMT 2022


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

Jakub Jelinek <jakub at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |jakub at gcc dot gnu.org

--- Comment #7 from Jakub Jelinek <jakub at gcc dot gnu.org> ---
I wonder if we shouldn't have a style warning for this though, if the empty
statement's ; is immediately after } in the source, tell user it is
unnecessary,
while not warning if there is some comment or newline or whitespace etc. in
between.
Ran into this while backporting PR105256 to gcc-10 branch which doesn't have
this fix and the testcase contains such a useless semicolon:
void S::Prefs::Load() {
  *this = {};
};


More information about the Gcc-bugs mailing list