1 // RUN: %clang_cc1 -fsyntax-only -verify -Wno-c++0x-compat %s 2 3 // The auto or register specifiers can be applied only to names of objects 4 // declared in a block (6.3) or to function parameters (8.4). 5 6 auto int ao; // expected-error {{illegal storage class on file-scoped variable}} 7 auto void af(); // expected-error {{illegal storage class on function}} 8 9 register int ro; // expected-error {{illegal storage class on file-scoped variable}} 10 register void rf(); // expected-error {{illegal storage class on function}} 11 12 struct S { 13 auto int ao; // expected-error {{storage class specified for a member declaration}} 14 auto void af(); // expected-error {{storage class specified for a member declaration}} 15 16 register int ro; // expected-error {{storage class specified for a member declaration}} 17 register void rf(); // expected-error {{storage class specified for a member declaration}} 18 }; 19 20 void foo(auto int ap, register int rp) { 21 auto int abo; 22 auto void abf(); // expected-error {{illegal storage class on function}} 23 24 register int rbo; 25 register void rbf(); // expected-error {{illegal storage class on function}} 26 } 27