clang 10.0.0git

Typedefs | Functions
SemaConcept.cpp File Reference
`#include "clang/Sema/SemaConcept.h"`
`#include "clang/Sema/Sema.h"`
`#include "clang/Sema/SemaInternal.h"`
`#include "clang/Sema/SemaDiagnostic.h"`
`#include "clang/Sema/TemplateDeduction.h"`
`#include "clang/Sema/Template.h"`
`#include "clang/Sema/Overload.h"`
`#include "clang/Sema/Initialization.h"`
`#include "clang/AST/ExprConcepts.h"`
`#include "clang/AST/RecursiveASTVisitor.h"`
`#include "clang/Basic/OperatorPrecedence.h"`
`#include "llvm/ADT/DenseMap.h"`
`#include "llvm/ADT/PointerUnion.h"`
Include dependency graph for SemaConcept.cpp:

Go to the source code of this file.

## Typedefs
using | NormalForm = llvm::SmallVector< llvm::SmallVector< AtomicConstraint *, 2 >, 4 >

## Functions
template<typename AtomicEvaluator >
static bool | calculateConstraintSatisfaction (Sema &S, const Expr *ConstraintExpr, ConstraintSatisfaction &Satisfaction, AtomicEvaluator &&Evaluator)
static bool | calculateConstraintSatisfaction (Sema &S, const NamedDecl *Template, ArrayRef< TemplateArgument > TemplateArgs, SourceLocation TemplateNameLoc, MultiLevelTemplateArgumentList &MLTAL, const Expr *ConstraintExpr, ConstraintSatisfaction &Satisfaction)
static bool | CheckConstraintSatisfaction (Sema &S, const NamedDecl *Template, ArrayRef< const Expr *> ConstraintExprs, ArrayRef< TemplateArgument > TemplateArgs, SourceRange TemplateIDRange, ConstraintSatisfaction &Satisfaction)
static void | diagnoseUnsatisfiedRequirement (Sema &S, concepts::ExprRequirement *Req, bool First)
static void | diagnoseUnsatisfiedRequirement (Sema &S, concepts::TypeRequirement *Req, bool First)
static void | diagnoseUnsatisfiedRequirement (Sema &S, concepts::NestedRequirement *Req, bool First)
static void | diagnoseWellFormedUnsatisfiedConstraintExpr (Sema &S, Expr *SubstExpr, bool First=true)
template<typename SubstitutionDiagnostic >
static void | diagnoseUnsatisfiedConstraintExpr (Sema &S, const Expr *E, const llvm::PointerUnion< Expr *, SubstitutionDiagnostic *> &Record, bool First=true)
static bool | substituteParameterMappings (Sema &S, NormalizedConstraint &N, ConceptDecl *Concept, ArrayRef< TemplateArgument > TemplateArgs, const ASTTemplateArgumentListInfo *ArgsAsWritten)
static NormalForm | makeCNF (const NormalizedConstraint &Normalized)
static NormalForm | makeDNF (const NormalizedConstraint &Normalized)
template<typename AtomicSubsumptionEvaluator >
static bool | subsumes (NormalForm PDNF, NormalForm QCNF, AtomicSubsumptionEvaluator E)
template<typename AtomicSubsumptionEvaluator >
static bool | subsumes (Sema &S, NamedDecl *DP, ArrayRef< const Expr *> P, NamedDecl *DQ, ArrayRef< const Expr *> Q, bool &Subsumes, AtomicSubsumptionEvaluator E)

## Typedef Documentation

## ◆ NormalForm

using NormalForm = llvm::SmallVector<llvm::SmallVector<AtomicConstraint *, 2>, 4>

Definition at line 766 of file SemaConcept.cpp.

## Function Documentation

## ◆ calculateConstraintSatisfaction() [1/2]

template<typename AtomicEvaluator >

static bool calculateConstraintSatisfaction | ( | Sema & | S,
|  | const Expr * | ConstraintExpr,
|  | ConstraintSatisfaction & | Satisfaction,
|  | AtomicEvaluator && | Evaluator
| ) |  |
| static

Definition at line 97 of file SemaConcept.cpp.

Referenced by clang::Sema::CheckConstraintSatisfaction().

## ◆ calculateConstraintSatisfaction() [2/2]

static bool calculateConstraintSatisfaction | ( | Sema & | S,
|  | const NamedDecl * | Template,
|  | ArrayRef< TemplateArgument > | TemplateArgs,
|  | SourceLocation | TemplateNameLoc,
|  | MultiLevelTemplateArgumentList & | MLTAL,
|  | const Expr * | ConstraintExpr,
|  | ConstraintSatisfaction & | Satisfaction
| ) |  |
| static

Definition at line 170 of file SemaConcept.cpp.

## ◆ CheckConstraintSatisfaction()

static bool CheckConstraintSatisfaction | ( | Sema & | S,
|  | const NamedDecl * | Template,
|  | ArrayRef< const Expr *> | ConstraintExprs,
|  | ArrayRef< TemplateArgument > | TemplateArgs,
|  | SourceRange | TemplateIDRange,
|  | ConstraintSatisfaction & | Satisfaction
| ) |  |
| static

Definition at line 233 of file SemaConcept.cpp.

Referenced by clang::Sema::BuildStaticAssertDeclaration(), clang::Sema::CheckFunctionConstraints(), clang::Sema::CheckInstantiatedFunctionTemplateConstraints(), clang::Sema::DiagnoseUseOfDecl(), and clang::Sema::EnsureTemplateArgumentListConstraints().

## ◆ diagnoseUnsatisfiedConstraintExpr()

template<typename SubstitutionDiagnostic >

static void diagnoseUnsatisfiedConstraintExpr | ( | Sema & | S,
|  | const Expr * | E,
|  | const llvm::PointerUnion< Expr *, SubstitutionDiagnostic *> & | Record,
|  | bool | First = `true`
| ) |  |
| static

Definition at line 575 of file SemaConcept.cpp.

Referenced by clang::Sema::DiagnoseUnsatisfiedConstraint().

## ◆ diagnoseUnsatisfiedRequirement() [1/3]

static void diagnoseUnsatisfiedRequirement | ( | Sema & | S,
|  | concepts::ExprRequirement * | Req,
|  | bool | First
| ) |  |
| static

Definition at line 366 of file SemaConcept.cpp.

## ◆ diagnoseUnsatisfiedRequirement() [2/3]

static void diagnoseUnsatisfiedRequirement | ( | Sema & | S,
|  | concepts::TypeRequirement * | Req,
|  | bool | First
| ) |  |
| static

Definition at line 430 of file SemaConcept.cpp.

## ◆ diagnoseUnsatisfiedRequirement() [3/3]

static void diagnoseUnsatisfiedRequirement | ( | Sema & | S,
|  | concepts::NestedRequirement * | Req,
|  | bool | First
| ) |  |
| static

Definition at line 457 of file SemaConcept.cpp.

## ◆ diagnoseWellFormedUnsatisfiedConstraintExpr()

static void diagnoseWellFormedUnsatisfiedConstraintExpr | ( | Sema & | S,
|  | Expr * | SubstExpr,
|  | bool | First = `true`
| ) |  |
| static

Definition at line 478 of file SemaConcept.cpp.

## ◆ makeCNF()

static NormalForm makeCNF | ( | const NormalizedConstraint & | Normalized | ) |
| static

Definition at line 768 of file SemaConcept.cpp.

References clang::NormalizedConstraint::CCK_Conjunction, clang::NormalizedConstraint::getAtomicConstraint(), clang::NormalizedConstraint::getCompoundKind(), clang::NormalizedConstraint::getLHS(), clang::NormalizedConstraint::getRHS(), and clang::NormalizedConstraint::isAtomic().

Referenced by subsumes().

## ◆ makeDNF()

static NormalForm makeDNF | ( | const NormalizedConstraint & | Normalized | ) |
| static

Definition at line 797 of file SemaConcept.cpp.

References clang::NormalizedConstraint::CCK_Disjunction, clang::NormalizedConstraint::getAtomicConstraint(), clang::NormalizedConstraint::getCompoundKind(), clang::NormalizedConstraint::getLHS(), clang::NormalizedConstraint::getRHS(), and clang::NormalizedConstraint::isAtomic().

Referenced by subsumes().

## ◆ substituteParameterMappings()

static bool substituteParameterMappings | ( | Sema & | S,
|  | NormalizedConstraint & | N,
|  | ConceptDecl * | Concept,
|  | ArrayRef< TemplateArgument > | TemplateArgs,
|  | const ASTTemplateArgumentListInfo * | ArgsAsWritten
| ) |  |
| static

Definition at line 631 of file SemaConcept.cpp.

## ◆ subsumes() [1/2]

template<typename AtomicSubsumptionEvaluator >

static bool subsumes | ( | NormalForm | PDNF,
|  | NormalForm | QCNF,
|  | AtomicSubsumptionEvaluator | E
| ) |  |
| static

Definition at line 828 of file SemaConcept.cpp.

Referenced by clang::Sema::IsAtLeastAsConstrained(), and subsumes().

## ◆ subsumes() [2/2]

template<typename AtomicSubsumptionEvaluator >

static bool subsumes | ( | Sema & | S,
|  | NamedDecl * | DP,
|  | ArrayRef< const Expr *> | P,
|  | NamedDecl * | DQ,
|  | ArrayRef< const Expr *> | Q,
|  | bool & | Subsumes,
|  | AtomicSubsumptionEvaluator | E
| ) |  |
| static

Definition at line 860 of file SemaConcept.cpp.

References clang::Sema::getNormalizedAssociatedConstraints(), makeCNF(), makeDNF(), and subsumes().