clang 20.0.0git
Classes | Public Types | Public Member Functions | Static Public Member Functions | Public Attributes | List of all members
clang::concepts::ExprRequirement Class Reference

A requires-expression requirement which queries the validity and properties of an expression ('simple' and 'compound' requirements). More...

#include "clang/AST/ExprConcepts.h"

Inheritance diagram for clang::concepts::ExprRequirement:
Inheritance graph
[legend]

Classes

class  ReturnTypeRequirement
 

Public Types

enum  SatisfactionStatus {
  SS_Dependent , SS_ExprSubstitutionFailure , SS_NoexceptNotMet , SS_TypeRequirementSubstitutionFailure ,
  SS_ConstraintsNotSatisfied , SS_Satisfied
}
 
- Public Types inherited from clang::concepts::Requirement
enum  RequirementKind { RK_Type , RK_Simple , RK_Compound , RK_Nested }
 

Public Member Functions

 ExprRequirement (Expr *E, bool IsSimple, SourceLocation NoexceptLoc, ReturnTypeRequirement Req, SatisfactionStatus Status, ConceptSpecializationExpr *SubstitutedConstraintExpr=nullptr)
 Construct a compound requirement.
 
 ExprRequirement (SubstitutionDiagnostic *E, bool IsSimple, SourceLocation NoexceptLoc, ReturnTypeRequirement Req={})
 Construct a compound requirement whose expression was a substitution failure.
 
bool isSimple () const
 
bool isCompound () const
 
bool hasNoexceptRequirement () const
 
SourceLocation getNoexceptLoc () const
 
SatisfactionStatus getSatisfactionStatus () const
 
bool isExprSubstitutionFailure () const
 
const ReturnTypeRequirementgetReturnTypeRequirement () const
 
ConceptSpecializationExprgetReturnTypeRequirementSubstitutedConstraintExpr () const
 
SubstitutionDiagnosticgetExprSubstitutionDiagnostic () const
 
ExprgetExpr () const
 
- Public Member Functions inherited from clang::concepts::Requirement
 Requirement (RequirementKind Kind, bool IsDependent, bool ContainsUnexpandedParameterPack, bool IsSatisfied=true)
 
RequirementKind getKind () const
 
bool isSatisfied () const
 
void setSatisfied (bool IsSatisfied)
 
void setDependent (bool IsDependent)
 
bool isDependent () const
 
void setContainsUnexpandedParameterPack (bool Contains)
 
bool containsUnexpandedParameterPack () const
 

Static Public Member Functions

static bool classof (const Requirement *R)
 

Public Attributes

friend ASTStmtReader
 
friend ASTStmtWriter
 

Detailed Description

A requires-expression requirement which queries the validity and properties of an expression ('simple' and 'compound' requirements).

Definition at line 280 of file ExprConcepts.h.

Member Enumeration Documentation

◆ SatisfactionStatus

Enumerator
SS_Dependent 
SS_ExprSubstitutionFailure 
SS_NoexceptNotMet 
SS_TypeRequirementSubstitutionFailure 
SS_ConstraintsNotSatisfied 
SS_Satisfied 

Definition at line 282 of file ExprConcepts.h.

Constructor & Destructor Documentation

◆ ExprRequirement() [1/2]

concepts::ExprRequirement::ExprRequirement ( Expr E,
bool  IsSimple,
SourceLocation  NoexceptLoc,
ReturnTypeRequirement  Req,
SatisfactionStatus  Status,
ConceptSpecializationExpr SubstitutedConstraintExpr = nullptr 
)

Construct a compound requirement.

Parameters
Ethe expression which is checked by this requirement.
IsSimplewhether this was a simple requirement in source.
NoexceptLocthe location of the noexcept keyword, if it was specified, otherwise an empty location.
Reqthe requirement for the type of the checked expression.
Statusthe satisfaction status of this requirement.

Definition at line 1873 of file SemaConcept.cpp.

References clang::concepts::ExprRequirement::ReturnTypeRequirement::isEmpty(), clang::SourceLocation::isInvalid(), clang::concepts::ExprRequirement::ReturnTypeRequirement::isTypeConstraint(), and SS_TypeRequirementSubstitutionFailure.

◆ ExprRequirement() [2/2]

concepts::ExprRequirement::ExprRequirement ( SubstitutionDiagnostic E,
bool  IsSimple,
SourceLocation  NoexceptLoc,
ReturnTypeRequirement  Req = {} 
)

Construct a compound requirement whose expression was a substitution failure.

The requirement is not satisfied.

Parameters
Ethe diagnostic emitted while instantiating the original expression.
IsSimplewhether this was a simple requirement in source.
NoexceptLocthe location of the noexcept keyword, if it was specified, otherwise an empty location.
Reqthe requirement for the type of the checked expression (omit if no requirement was specified).

Definition at line 1891 of file SemaConcept.cpp.

References clang::concepts::ExprRequirement::ReturnTypeRequirement::isEmpty(), and clang::SourceLocation::isInvalid().

Member Function Documentation

◆ classof()

static bool clang::concepts::ExprRequirement::classof ( const Requirement R)
inlinestatic

◆ getExpr()

Expr * clang::concepts::ExprRequirement::getExpr ( ) const
inline

◆ getExprSubstitutionDiagnostic()

SubstitutionDiagnostic * clang::concepts::ExprRequirement::getExprSubstitutionDiagnostic ( ) const
inline

◆ getNoexceptLoc()

SourceLocation clang::concepts::ExprRequirement::getNoexceptLoc ( ) const
inline

◆ getReturnTypeRequirement()

const ReturnTypeRequirement & clang::concepts::ExprRequirement::getReturnTypeRequirement ( ) const
inline

◆ getReturnTypeRequirementSubstitutedConstraintExpr()

ConceptSpecializationExpr * clang::concepts::ExprRequirement::getReturnTypeRequirementSubstitutedConstraintExpr ( ) const
inline

Definition at line 403 of file ExprConcepts.h.

References SS_TypeRequirementSubstitutionFailure.

Referenced by diagnoseUnsatisfiedRequirement().

◆ getSatisfactionStatus()

SatisfactionStatus clang::concepts::ExprRequirement::getSatisfactionStatus ( ) const
inline

Definition at line 392 of file ExprConcepts.h.

Referenced by diagnoseUnsatisfiedRequirement().

◆ hasNoexceptRequirement()

bool clang::concepts::ExprRequirement::hasNoexceptRequirement ( ) const
inline

Definition at line 389 of file ExprConcepts.h.

References clang::SourceLocation::isValid().

◆ isCompound()

bool clang::concepts::ExprRequirement::isCompound ( ) const
inline

◆ isExprSubstitutionFailure()

bool clang::concepts::ExprRequirement::isExprSubstitutionFailure ( ) const
inline

◆ isSimple()

bool clang::concepts::ExprRequirement::isSimple ( ) const
inline

Member Data Documentation

◆ ASTStmtReader

friend clang::concepts::ExprRequirement::ASTStmtReader

Definition at line 359 of file ExprConcepts.h.

◆ ASTStmtWriter

friend clang::concepts::ExprRequirement::ASTStmtWriter

Definition at line 360 of file ExprConcepts.h.


The documentation for this class was generated from the following files: