clang 10.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:
[legend]
Collaboration diagram for clang::concepts::ExprRequirement:
[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. More...
| ExprRequirement (SubstitutionDiagnostic *E, bool IsSimple, SourceLocation NoexceptLoc, ReturnTypeRequirement Req={})
| Construct a compound requirement whose expression was a substitution failure. More...
bool | isSimple () const
bool | isCompound () const
bool | hasNoexceptRequirement () const
SourceLocation | getNoexceptLoc () const
SatisfactionStatus | getSatisfactionStatus () const
bool | isExprSubstitutionFailure () const
const ReturnTypeRequirement & | getReturnTypeRequirement () const
ConceptSpecializationExpr * | getReturnTypeRequirementSubstitutedConstraintExpr () const
SubstitutionDiagnostic * | getExprSubstitutionDiagnostic () const
Expr * | getExpr () 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 240 of file ExprConcepts.h.

## Member Enumeration Documentation

## ◆ SatisfactionStatus

enum clang::concepts::ExprRequirement::SatisfactionStatus

Enumerator
SS_Dependent |
SS_ExprSubstitutionFailure |
SS_NoexceptNotMet |
SS_TypeRequirementSubstitutionFailure |
SS_ConstraintsNotSatisfied |
SS_Satisfied |

Definition at line 242 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

  E | the expression which is checked by this requirement.
  IsSimple | whether this was a simple requirement in source.
  NoexceptLoc | the location of the noexcept keyword, if it was specified, otherwise an empty location.
  Req | the requirement for the type of the checked expression.
  Status | the satisfaction status of this requirement.

Definition at line 982 of file SemaConcept.cpp.

## ◆ 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

  E | the diagnostic emitted while instantiating the original expression.
  IsSimple | whether this was a simple requirement in source.
  NoexceptLoc | the location of the noexcept keyword, if it was specified, otherwise an empty location.
  Req | the requirement for the type of the checked expression (omit if no requirement was specified).

Definition at line 1000 of file SemaConcept.cpp.

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

## Member Function Documentation

## ◆ classof()

static bool clang::concepts::ExprRequirement::classof | ( | const Requirement * | R | ) |
| inline static

Definition at line 382 of file ExprConcepts.h.

References clang::concepts::Requirement::getKind().

## ◆ getExpr()

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

Definition at line 375 of file ExprConcepts.h.

Referenced by clang::TreeTransform< Derived >::TransformExprRequirement().

## ◆ getExprSubstitutionDiagnostic()

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

Definition at line 368 of file ExprConcepts.h.

Referenced by clang::TreeTransform< Derived >::TransformExprRequirement().

## ◆ getNoexceptLoc()

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

Definition at line 350 of file ExprConcepts.h.

Referenced by clang::TreeTransform< Derived >::TransformExprRequirement().

## ◆ getReturnTypeRequirement()

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

Definition at line 358 of file ExprConcepts.h.

Referenced by clang::TreeTransform< Derived >::TransformExprRequirement().

## ◆ getReturnTypeRequirementSubstitutedConstraintExpr()

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

Definition at line 363 of file ExprConcepts.h.

## ◆ getSatisfactionStatus()

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

Definition at line 352 of file ExprConcepts.h.

## ◆ hasNoexceptRequirement()

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

Definition at line 349 of file ExprConcepts.h.

References clang::SourceLocation::isValid().

## ◆ isCompound()

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

Definition at line 347 of file ExprConcepts.h.

References getKind().

## ◆ isExprSubstitutionFailure()

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

Definition at line 354 of file ExprConcepts.h.

Referenced by clang::TreeTransform< Derived >::TransformExprRequirement().

## ◆ isSimple()

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

Definition at line 346 of file ExprConcepts.h.

References getKind().

Referenced by clang::TreeTransform< Derived >::TransformExprRequirement().

## Member Data Documentation

## ◆ ASTStmtReader

friend clang::concepts::ExprRequirement::ASTStmtReader

Definition at line 319 of file ExprConcepts.h.

## ◆ ASTStmtWriter

friend clang::concepts::ExprRequirement::ASTStmtWriter

Definition at line 320 of file ExprConcepts.h.

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

- include/clang/AST/ExprConcepts.h
- lib/Sema/SemaConcept.cpp