summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--clang/lib/Sema/SemaLookup.cpp2
-rw-r--r--clang/test/SemaCXX/typo-correction-cxx17.cpp7
2 files changed, 9 insertions, 0 deletions
diff --git a/clang/lib/Sema/SemaLookup.cpp b/clang/lib/Sema/SemaLookup.cpp
index 984247bacc6..4545bf9d855 100644
--- a/clang/lib/Sema/SemaLookup.cpp
+++ b/clang/lib/Sema/SemaLookup.cpp
@@ -4990,6 +4990,8 @@ bool FunctionCallFilterCCC::ValidateCandidate(const TypoCorrection &candidate) {
// determine if it is a pointer or reference to a function. If so,
// check against the number of arguments expected for the pointee.
QualType ValType = cast<ValueDecl>(ND)->getType();
+ if (ValType.isNull())
+ continue;
if (ValType->isAnyPointerType() || ValType->isReferenceType())
ValType = ValType->getPointeeType();
if (const FunctionProtoType *FPT = ValType->getAs<FunctionProtoType>())
diff --git a/clang/test/SemaCXX/typo-correction-cxx17.cpp b/clang/test/SemaCXX/typo-correction-cxx17.cpp
new file mode 100644
index 00000000000..f1374997534
--- /dev/null
+++ b/clang/test/SemaCXX/typo-correction-cxx17.cpp
@@ -0,0 +1,7 @@
+// RUN: %clang_cc1 -std=c++1z -fsyntax-only -verify %s
+
+namespace decomp_decl {
+void f() {
+ auto [this_is_a_typo] = this_is_a_typp(); // expected-error{{use of undeclared identifier 'this_is_a_typp'}}
+}
+}
OpenPOWER on IntegriCloud