Add a .isNull() check to returned QualType. Fixes PR38077
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@336475
91177308-0d34-0410-b5e6-
96231b3b80d8
assert(DS.getTypeSpecType() == DeclSpec::TST_decltype);
QualType T = BuildDecltypeType(DS.getRepAsExpr(), DS.getTypeSpecTypeLoc());
+ if (T.isNull())
+ return true;
+
if (!T->isDependentType() && !T->getAs<TagType>()) {
Diag(DS.getTypeSpecTypeLoc(), diag::err_expected_class_or_namespace)
<< T << getLangOpts().CPlusPlus;
}
};
}
+
+namespace PR38077 {
+ template <class T> void bar() {} // expected-note {{possible target for call}}
+
+ int run() {
+ decltype(bar)::does_not_exist; // expected-error {{reference to overloaded function could not be resolved; did you mean to call it?}}
+ }
+}