55//  The auto or register specifiers can be applied only to names of objects
66//  declared in a block (6.3) or to function parameters (8.4).
77
8- auto  int  ao;  //  expected-error {{illegal storage class on file-scoped variable}} 
8+ auto  int  ao;
99#if  __cplusplus >= 201103L //  C++11 or later
10- //  expected-warning@-2 {{'auto' storage class specifier is not permitted in C++11, and will not be supported in future releases}}
10+ //  expected-error@-2 {{'auto' cannot be combined with a type specifier in C++}}
11+ #else 
12+ //  expected-error@-4 {{illegal storage class on file-scoped variable}}
1113#endif 
1214
13- auto  void  af ();  //  expected-error {{illegal storage class on function}} 
15+ auto  void  af ();
1416#if  __cplusplus >= 201103L //  C++11 or later
15- //  expected-warning@-2 {{'auto' storage class specifier is not permitted in C++11, and will not be supported in future releases}}
17+ //  expected-error@-2 {{'auto' cannot be combined with a type specifier in C++}}
18+ #else 
19+ //  expected-error@-4 {{illegal storage class on function}}
1620#endif 
1721
1822register  int  ro; //  expected-error {{illegal storage class on file-scoped variable}}
@@ -25,13 +29,17 @@ register int ro; // expected-error {{illegal storage class on file-scoped variab
2529register  void  rf (); //  expected-error {{illegal storage class on function}}
2630
2731struct  S  {
28-   auto  int  ao;  //  expected-error {{storage class specified for a member declaration}} 
32+   auto  int  ao;
2933#if  __cplusplus >= 201103L //  C++11 or later
30- //  expected-warning@-2 {{'auto' storage class specifier is not permitted in C++11, and will not be supported in future releases}}
34+ //  expected-error@-2 {{'auto' cannot be combined with a type specifier in C++}}
35+ #else 
36+ //  expected-error@-4 {{storage class specified for a member declaration}}
3137#endif 
32-   auto  void  af ();  //  expected-error {{storage class specified for a member declaration}} 
38+   auto  void  af ();
3339#if  __cplusplus >= 201103L //  C++11 or later
34- //  expected-warning@-2 {{'auto' storage class specifier is not permitted in C++11, and will not be supported in future releases}}
40+ //  expected-error@-2 {{'auto' cannot be combined with a type specifier in C++}}
41+ #else 
42+ //  expected-error@-4 {{storage class specified for a member declaration}}
3543#endif 
3644
3745  register  int  ro; //  expected-error {{storage class specified for a member declaration}}
@@ -40,19 +48,21 @@ struct S {
4048
4149void  foo (auto  int  ap, register  int  rp) {
4250#if  __cplusplus >= 201703L
43- //  expected-warning @-2 {{'auto' storage class specifier is not permitted  in C++11, and will not be supported in future releases }}
51+ //  expected-error @-2 {{'auto' cannot be combined with a type specifier  in C++}}
4452//  expected-error@-3 {{ISO C++17 does not allow 'register' storage class specifier}}
4553#elif  __cplusplus >= 201103L
46- //  expected-warning @-5 {{'auto' storage class specifier is not permitted  in C++11, and will not be supported in future releases }}
54+ //  expected-error @-5 {{'auto' cannot be combined with a type specifier  in C++}}
4755//  expected-warning@-6 {{'register' storage class specifier is deprecated}}
4856#endif 
4957  auto  int  abo;
5058#if  __cplusplus >= 201103L //  C++11 or later
51- //  expected-warning @-2 {{'auto' storage class specifier is not permitted  in C++11, and will not be supported in future releases }}
59+ //  expected-error @-2 {{'auto' cannot be combined with a type specifier  in C++}}
5260#endif 
53-   auto  void  abf ();  //  expected-error {{illegal storage class on function}} 
61+   auto  void  abf ();
5462#if  __cplusplus >= 201103L //  C++11 or later
55- //  expected-warning@-2 {{'auto' storage class specifier is not permitted in C++11, and will not be supported in future releases}}
63+ //  expected-error@-2 {{'auto' cannot be combined with a type specifier in C++}}
64+ #else 
65+ //  expected-error@-4 {{illegal storage class on function}}
5666#endif 
5767
5868  register  int  rbo;
0 commit comments