Add a .isNull() check to returned QualType. Fixes PR38077
llvm-svn: 336475
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?}}
+ }
+}