2011-10-14 06:29:44 +08:00
|
|
|
// RUN: %clang_cc1 -fsyntax-only -verify %s -std=c++11
|
2015-11-11 10:02:15 +08:00
|
|
|
// RUN: %clang_cc1 -fsyntax-only -verify %s -std=c++1y
|
2009-06-27 02:41:36 +08:00
|
|
|
void f() {
|
2011-10-13 03:26:40 +08:00
|
|
|
auto int a; // expected-warning {{'auto' storage class specifier is not permitted in C++11, and will not be supported in future releases}}
|
2009-06-27 02:41:36 +08:00
|
|
|
int auto b; // expected-error{{cannot combine with previous 'int' declaration specifier}}
|
|
|
|
}
|
2015-11-11 10:02:15 +08:00
|
|
|
|
|
|
|
typedef auto PR25449(); // expected-error {{'auto' not allowed in typedef}}
|
2017-01-28 05:28:37 +08:00
|
|
|
|
|
|
|
thread_local auto x; // expected-error {{requires an initializer}}
|
2017-02-04 09:28:01 +08:00
|
|
|
|
|
|
|
void g() {
|
|
|
|
[](auto){}(0);
|
|
|
|
#if __cplusplus == 201103L
|
|
|
|
// expected-error@-2 {{'auto' not allowed in lambda parameter}}
|
|
|
|
#endif
|
|
|
|
}
|
2019-03-30 02:47:07 +08:00
|
|
|
|
|
|
|
void rdar47689465() {
|
|
|
|
int x = 0;
|
|
|
|
[](auto __attribute__((noderef)) *){}(&x);
|
|
|
|
#if __cplusplus == 201103L
|
|
|
|
// expected-error@-2 {{'auto' not allowed in lambda parameter}}
|
|
|
|
#endif
|
|
|
|
}
|