c++: Allow empty-declaration in C++11 and later (PR 96068)
authorJonathan Wakely <jwakely@redhat.com>
Mon, 6 Jul 2020 14:58:33 +0000 (15:58 +0100)
committerJonathan Wakely <jwakely@redhat.com>
Mon, 6 Jul 2020 16:12:23 +0000 (17:12 +0100)
commit92414bb6b077642eefc24080637b6bc766499391
tree668571cf17cbe28922e9198f4441e5d69566ade1
parentdccbf1e2a6e544f71b4a5795f0c79015db019fc3
c++: Allow empty-declaration in C++11 and later (PR 96068)

Since C++11 a semim-colon on its own at namespace scope is not invalid,
so do not give a pedantic diagnostic about it.

gcc/cp/ChangeLog:

PR c++/96068
* parser.c (cp_parser_toplevel_declaration): Only do pedwarn for
empty-declaration in C++98.

gcc/testsuite/ChangeLog:

* g++.old-deja/g++.bugs/900404_04.C: Add c++98_only selector to
dg-error for extra ';'.
* g++.old-deja/g++.law/missed-error2.C: Likewise.
gcc/cp/parser.c
gcc/testsuite/g++.old-deja/g++.bugs/900404_04.C
gcc/testsuite/g++.old-deja/g++.law/missed-error2.C