Debian Codegraph @

gcc/testsuite/g++.dg/diagnostic/semicolon17.C

raw
1 // DR 569, Spurious semicolons at namespace scope should be allowed
2 // PR c++/113760
3 // { dg-options "-pedantic-errors -Wno-error=extra-semi" }
4
5 // C++11 allows extra semicolons at namespace scope.
6 struct S {
7 void foo();
8 };
9 ; // { dg-warning "extra .;. outside of a function" "" { target c++98_only } }
10
11 void S::foo () {
12 }; // { dg-warning "extra .;. outside of a function" "" { target c++98_only } }
13 ; // { dg-warning "extra .;. outside of a function" "" { target c++98_only } }
14
15 namespace N {
16 }; // { dg-warning "extra .;. outside of a function" "" { target c++98_only } }
17 ; // { dg-warning "extra .;. outside of a function" "" { target c++98_only } }
18
19 void f();
20 ; // { dg-warning "extra .;. outside of a function" "" { target c++98_only } }
21
22 void
23 f ()
24 {
25 }; // { dg-warning "extra .;. outside of a function" "" { target c++98_only } }
26 ; // { dg-warning "extra .;. outside of a function" "" { target c++98_only } }
27
28 int x;
29 ; // { dg-warning "extra .;. outside of a function" "" { target c++98_only } }