BindingDecls have null type until their initializer is processed, so we can't
assume that a correction candidate has non-null type.
rdar://
41559582
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@336634
91177308-0d34-0410-b5e6-
96231b3b80d8
// 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>())
--- /dev/null
+// 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'}}
+}
+}