Fortran: Fix PR 47485.
[gcc.git] / gcc / testsuite / g++.dg / diagnostic / semicolon17.C
blob0b8d3f006e5722bd4c06589db9ddc2a33e07eae0
1 // DR 569, Spurious semicolons at namespace scope should be allowed
2 // PR c++/113760
3 // { dg-options "-pedantic-errors -Wno-error=extra-semi" }
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 } }
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 } }
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 } }
19 void f();
20 ;                       // { dg-warning "extra .;. outside of a function" "" { target c++98_only } }
22 void
23 f ()
25 };                      // { dg-warning "extra .;. outside of a function" "" { target c++98_only } }
26 ;                       // { dg-warning "extra .;. outside of a function" "" { target c++98_only } }
28 int x;
29 ;                       // { dg-warning "extra .;. outside of a function" "" { target c++98_only } }