2014-11-22 02:48:04 +08:00
|
|
|
// RUN: %clang_cc1 -fsyntax-only -verify %s
|
|
|
|
//
|
|
|
|
// This file contains typo correction tests which hit different code paths in C
|
|
|
|
// than in C++ and may exhibit different behavior as a result.
|
|
|
|
|
|
|
|
__typeof__(struct F*) var[invalid]; // expected-error-re {{use of undeclared identifier 'invalid'{{$}}}}
|
2014-11-25 05:46:59 +08:00
|
|
|
|
|
|
|
void PR21656() {
|
|
|
|
float x;
|
|
|
|
x = (float)arst; // expected-error-re {{use of undeclared identifier 'arst'{{$}}}}
|
|
|
|
}
|
2015-01-08 05:16:39 +08:00
|
|
|
|
|
|
|
a = b ? : 0; // expected-warning {{type specifier missing, defaults to 'int'}} \
|
|
|
|
// expected-error {{use of undeclared identifier 'b'}}
|
2015-01-09 17:37:26 +08:00
|
|
|
|
|
|
|
struct ContainerStuct {
|
|
|
|
enum { SOME_ENUM }; // expected-note {{'SOME_ENUM' declared here}}
|
|
|
|
};
|
|
|
|
|
|
|
|
void func(int arg) {
|
|
|
|
switch (arg) {
|
|
|
|
case SOME_ENUM_:
|
|
|
|
; // expected-error {{use of undeclared identifier 'SOME_ENUM_'; did you mean 'SOME_ENUM'}}
|
|
|
|
}
|
|
|
|
}
|