// However, they cannot be referenced if they are deleted, and they are
// deleted whenever the implicit definition of the special member would
// fail.
- if (!Func->isConstexpr() || Func->getBody())
+ if (!(Func->isConstexpr() && !getLangOpts().DelayedTemplateParsing) ||
+ Func->getBody())
return;
CXXMethodDecl *MD = dyn_cast<CXXMethodDecl>(Func);
if (!Func->isImplicitlyInstantiable() && (!MD || MD->isUserProvided()))
}
}
- if (!AlreadyInstantiated || Func->isConstexpr()) {
+ if (!AlreadyInstantiated ||
+ (Func->isConstexpr() && !getLangOpts().DelayedTemplateParsing)) {
if (isa<CXXRecordDecl>(Func->getDeclContext()) &&
cast<CXXRecordDecl>(Func->getDeclContext())->isLocalClass() &&
ActiveTemplateInstantiations.size())
PendingLocalImplicitInstantiations.push_back(
std::make_pair(Func, PointOfInstantiation));
- else if (Func->isConstexpr())
+ else if (Func->isConstexpr() && !getLangOpts().DelayedTemplateParsing)
// Do not defer instantiations of constexpr functions, to avoid the
// expression evaluator needing to call back into Sema if it sees a
// call to such a function.
};
}
+namespace PR17334 {
+
+template <typename = void> struct ArrayRef {
+ constexpr ArrayRef() {}
+};
+template <typename = void> void CreateConstInBoundsGEP2_32() {
+ ArrayRef<> IdxList;
+}
+void LLVMBuildStructGEP() { CreateConstInBoundsGEP2_32(); }
+
+}
+