| 1 |
// RUN: %clang_cc1 -std=c++11 -fsyntax-only -verify %s |
| 2 |
|
| 3 |
namespace PR23186 { |
| 4 |
decltype(ned); // expected-error {{use of undeclared identifier 'ned'}} |
| 5 |
// The code below was triggering an UNREACHABLE in ASTContext::getTypeInfoImpl |
| 6 |
// once the above code failed to recover properly after making the bogus |
| 7 |
// correction of 'ned' to 'new'. |
| 8 |
template <typename> |
| 9 |
struct S { |
| 10 |
enum { V }; |
| 11 |
void f() { |
| 12 |
switch (0) |
| 13 |
case V: |
| 14 |
; |
| 15 |
} |
| 16 |
}; |
| 17 |
} |
| 18 |
|
| 19 |
namespace PR23140 { |
| 20 |
auto lneed = gned.*[] {}; // expected-error-re {{use of undeclared identifier 'gned'{{$}}}} |
| 21 |
|
| 22 |
void test(int aaa, int bbb, int thisvar) { |
| 23 |
int thatval = aaa * (bbb + thatvar); // expected-error {{use of undeclared identifier 'thatvar'; did you mean 'thatval'}} \ |
| 24 |
expected-note {{'thatval' declared here}} |
| 25 |
} |
| 26 |
} |
| 27 |
|
| 28 |
namespace PR18854 { |
| 29 |
void f() { |
| 30 |
for (auto&& x : e) { // expected-error-re {{use of undeclared identifier 'e'{{$}}}} |
| 31 |
auto Functor = [x]() {}; |
| 32 |
long Alignment = __alignof__(Functor); |
| 33 |
} |
| 34 |
} |
| 35 |
} |
| 36 |
|
| 37 |
namespace NewTypoExprFromResolvingTypoAmbiguity { |
| 38 |
struct A { |
| 39 |
void Swap(A *other); |
| 40 |
}; |
| 41 |
|
| 42 |
struct pair { |
| 43 |
int first; |
| 44 |
A *second; |
| 45 |
}; |
| 46 |
|
| 47 |
struct map { |
| 48 |
public: |
| 49 |
void swap(map &x); |
| 50 |
pair find(int x); |
| 51 |
}; |
| 52 |
|
| 53 |
void run(A *annotations) { |
| 54 |
map new_annotations; |
| 55 |
|
| 56 |
auto &annotation = *annotations; |
| 57 |
auto new_it = new_annotations.find(5); |
| 58 |
auto &new_anotation = new_it.second; |
| 59 |
new_annotation->Swap(&annotation); // expected-error {{use of undeclared identifier 'new_annotation'}} |
| 60 |
} |
| 61 |
} |