LWG 3035. std::allocator's constructors should be constexpr
[official-gcc.git] / gcc / testsuite / gcc.dg / declspec-8.c
bloba26cfa4d75b35b17afa891fd42a6290d313cbc6e
1 /* Test declaration specifiers. Test checks on storage class
2 specifiers and function specifiers in empty declarations. */
3 /* Origin: Joseph Myers <jsm@polyomino.org.uk> */
4 /* { dg-do compile } */
5 /* { dg-options "" } */
7 /* The constraints on storage class specifiers and function specifiers
8 must be met for empty declarations where they are useless. Thus
9 there may be only one storage class specifier (C90 6.5.1, C99
10 6.7.1#2) and "inline" must not be used because the declaration is
11 not that of an identifier for a function (C99 6.7.4#1), and
12 "register" and "auto" must not be used at file scope (C90 6.7, C99
13 6.9#2). */
15 static static struct s; /* { dg-error "duplicate 'static'" } */
16 /* { dg-warning "useless storage class specifier in empty declaration" "static static" { target *-*-* } .-1 } */
18 static extern struct t; /* { dg-error "multiple storage classes in declaration specifiers" } */
19 /* { dg-warning "useless storage class specifier in empty declaration" "static extern" { target *-*-* } .-1 } */
21 inline union u; /* { dg-error "'inline' in empty declaration" } */
23 auto struct v; /* { dg-error "'auto' in file-scope empty declaration" } */
25 register struct w; /* { dg-error "'register' in file-scope empty declaration" } */
27 void
28 f (void)
30 auto union p; /* { dg-warning "useless storage class specifier in empty declaration" } */
31 register struct q; /* { dg-warning "useless storage class specifier in empty declaration" } */