mirror of
https://github.com/intel/llvm.git
synced 2026-01-26 21:53:12 +08:00
[NFC] Make sure we check an optional when checking function constraints
For some reason the initial deferred concepts patch didn't add this check, which someone noticed could cause a problem with other patches applied. This makes sure we check these, so that an error condition cannot cause us to crash.
This commit is contained in:
@@ -7211,7 +7211,7 @@ private:
|
||||
FunctionDecl *FD, llvm::Optional<ArrayRef<TemplateArgument>> TemplateArgs,
|
||||
MultiLevelTemplateArgumentList MLTAL, LocalInstantiationScope &Scope);
|
||||
|
||||
/// Used during constraint checking, sets up the constraint template arguemnt
|
||||
/// Used during constraint checking, sets up the constraint template argument
|
||||
/// lists, and calls SetupConstraintScope to set up the
|
||||
/// LocalInstantiationScope to have the proper set of ParVarDecls configured.
|
||||
llvm::Optional<MultiLevelTemplateArgumentList>
|
||||
|
||||
@@ -511,7 +511,7 @@ Sema::SetupConstraintCheckingTemplateArgumentsAndScope(
|
||||
/*Pattern=*/nullptr,
|
||||
/*ForConstraintInstantiation=*/true);
|
||||
if (SetupConstraintScope(FD, TemplateArgs, MLTAL, Scope))
|
||||
return {};
|
||||
return llvm::None;
|
||||
|
||||
return MLTAL;
|
||||
}
|
||||
@@ -547,6 +547,9 @@ bool Sema::CheckFunctionConstraints(const FunctionDecl *FD,
|
||||
SetupConstraintCheckingTemplateArgumentsAndScope(
|
||||
const_cast<FunctionDecl *>(FD), {}, Scope);
|
||||
|
||||
if (!MLTAL)
|
||||
return true;
|
||||
|
||||
Qualifiers ThisQuals;
|
||||
CXXRecordDecl *Record = nullptr;
|
||||
if (auto *Method = dyn_cast<CXXMethodDecl>(FD)) {
|
||||
|
||||
Reference in New Issue
Block a user