diff options
author | Yi Kong <yikong@google.com> | 2017-09-25 17:36:54 +0000 |
---|---|---|
committer | Yi Kong <yikong@google.com> | 2017-09-25 17:36:54 +0000 |
commit | 51797d878f42f0d79c8d8dea280295aff1276069 (patch) | |
tree | 62c277f1a7c07f2c10366be29fc3d3463cb79339 /test/SemaCXX/typo-correction-crash.cpp | |
parent | 1d3c5c33049210f9b74e47ee3cbc03629b108409 (diff) |
[Sema] Null check in BuildDeclarationNameExpr
Qualtype may point to null if we cannot infer its type yet.
Fixes PR33843
Differential Revision: https://reviews.llvm.org/D38158
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@314124 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test/SemaCXX/typo-correction-crash.cpp')
-rw-r--r-- | test/SemaCXX/typo-correction-crash.cpp | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/test/SemaCXX/typo-correction-crash.cpp b/test/SemaCXX/typo-correction-crash.cpp index 0b8383dbaf..b7b9c73a0c 100644 --- a/test/SemaCXX/typo-correction-crash.cpp +++ b/test/SemaCXX/typo-correction-crash.cpp @@ -1,4 +1,4 @@ -// RUN: %clang_cc1 -fsyntax-only -std=c++14 -verify %s +// RUN: %clang_cc1 -fsyntax-only -std=c++17 -verify %s auto check1() { return 1; return s; // expected-error {{use of undeclared identifier 's'}} @@ -19,3 +19,5 @@ struct FooRecord { }; FooRecord::NestedNamespace::type x; // expected-error {{no member named 'NestedNamespace' in 'FooRecord'; did you mean 'BarNamespace::NestedNamespace'?}} void cast_expr(int g) { +int(n)(g); } // expected-error {{undeclared identifier 'n'}} + +void bind() { for (const auto& [test,_] : _test_) { }; } // expected-error {{undeclared identifier '_test_'}} |