https://gcc.gnu.org/bugzilla/show_bug.cgi?id=103131
Andrew Pinski <pinskia at gcc dot gnu.org> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|UNCONFIRMED |RESOLVED Resolution|--- |DUPLICATE --- Comment #2 from Andrew Pinski <pinskia at gcc dot gnu.org> --- Because for C++11 (and above), it is valid to have just ; without anything before it. GCC 11 fixed that bug. You still get the pedantic warning if you use -std=c++03 (or -std=c++98 or -std=gnu++03 or -std=gnu++98). *** This bug has been marked as a duplicate of bug 96068 ***