clang 22.0.0git
ExprConcepts.h
Go to the documentation of this file.
1//===- ExprConcepts.h - C++2a Concepts expressions --------------*- C++ -*-===//
2//
3// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
4// See https://llvm.org/LICENSE.txt for license information.
5// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
6//
7//===----------------------------------------------------------------------===//
8//
9/// \file
10/// Defines Expressions and AST nodes for C++2a concepts.
11//
12//===----------------------------------------------------------------------===//
13
14#ifndef LLVM_CLANG_AST_EXPRCONCEPTS_H
15#define LLVM_CLANG_AST_EXPRCONCEPTS_H
16
19#include "clang/AST/Decl.h"
22#include "clang/AST/Expr.h"
25#include "clang/AST/Type.h"
27#include "llvm/ADT/STLFunctionalExtras.h"
28#include "llvm/Support/ErrorHandling.h"
29#include "llvm/Support/TrailingObjects.h"
30#include <string>
31#include <utility>
32
33namespace clang {
34class ASTStmtReader;
35class ASTStmtWriter;
36
37/// \brief Represents the specialization of a concept - evaluates to a prvalue
38/// of type bool.
39///
40/// According to C++2a [expr.prim.id]p3 an id-expression that denotes the
41/// specialization of a concept results in a prvalue of type bool.
42class ConceptSpecializationExpr final : public Expr {
43 friend class ASTReader;
44 friend class ASTStmtReader;
45
46private:
47 ConceptReference *ConceptRef;
48
49 /// \brief The Implicit Concept Specialization Decl, which holds the template
50 /// arguments for this specialization.
52
53 /// \brief Information about the satisfaction of the named concept with the
54 /// given arguments. If this expression is value dependent, this is to be
55 /// ignored.
56 ASTConstraintSatisfaction *Satisfaction;
57
60 const ConstraintSatisfaction *Satisfaction);
61
64 const ConstraintSatisfaction *Satisfaction,
65 bool Dependent,
66 bool ContainsUnexpandedParameterPack);
68
69public:
71 Create(const ASTContext &C, ConceptReference *ConceptRef,
73 const ConstraintSatisfaction *Satisfaction);
74
76 Create(const ASTContext &C, ConceptReference *ConceptRef,
78 const ConstraintSatisfaction *Satisfaction, bool Dependent,
79 bool ContainsUnexpandedParameterPack);
80
82 return SpecDecl->getTemplateArguments();
83 }
84
85 ConceptReference *getConceptReference() const { return ConceptRef; }
86
88 return cast<ConceptDecl>(ConceptRef->getNamedConcept());
89 }
90
91 // FIXME: Several of the following functions can be removed. Instead the
92 // caller can directly work with the ConceptReference.
94 return ConceptRef->hasExplicitTemplateArgs();
95 }
96
98 return ConceptRef->getConceptNameLoc();
99 }
101 return ConceptRef->getTemplateArgsAsWritten();
102 }
103
105 return ConceptRef->getNestedNameSpecifierLoc();
106 }
107
109 return ConceptRef->getTemplateKWLoc();
110 }
111
112 NamedDecl *getFoundDecl() const { return ConceptRef->getFoundDecl(); }
113
115 return ConceptRef->getConceptNameInfo();
116 }
117
119 assert(SpecDecl && "Template Argument Decl not initialized");
120 return SpecDecl;
121 }
122
123 /// \brief Whether or not the concept with the given arguments was satisfied
124 /// when the expression was created.
125 /// The expression must not be dependent.
126 bool isSatisfied() const {
127 assert(!isValueDependent() &&
128 "isSatisfied called on a dependent ConceptSpecializationExpr");
129 return Satisfaction->IsSatisfied;
130 }
131
132 /// \brief Get elaborated satisfaction info about the template arguments'
133 /// satisfaction of the named concept.
134 /// The expression must not be dependent.
136 assert(!isValueDependent() &&
137 "getSatisfaction called on dependent ConceptSpecializationExpr");
138 return *Satisfaction;
139 }
140
141 static bool classof(const Stmt *T) {
142 return T->getStmtClass() == ConceptSpecializationExprClass;
143 }
144
145 SourceLocation getBeginLoc() const LLVM_READONLY {
146 return ConceptRef->getBeginLoc();
147 }
148
149 SourceLocation getEndLoc() const LLVM_READONLY {
150 return ConceptRef->getEndLoc();
151 }
152
153 SourceLocation getExprLoc() const LLVM_READONLY {
154 return ConceptRef->getLocation();
155 }
156
157 // Iterators
160 }
163 }
164};
165
166namespace concepts {
167
168/// \brief A static requirement that can be used in a requires-expression to
169/// check properties of types and expression.
171public:
172 // Note - simple and compound requirements are both represented by the same
173 // class (ExprRequirement).
175private:
176 const RequirementKind Kind;
177 // FIXME: use RequirementDependence to model dependence?
178 LLVM_PREFERRED_TYPE(bool)
179 bool Dependent : 1;
180 LLVM_PREFERRED_TYPE(bool)
181 bool ContainsUnexpandedParameterPack : 1;
182 LLVM_PREFERRED_TYPE(bool)
183 bool Satisfied : 1;
184public:
187 // FIXME: Store diagnostics semantically and not as prerendered strings.
188 // Fixing this probably requires serialization of PartialDiagnostic
189 // objects.
191 StringRef DiagMessage;
192 };
193
194 Requirement(RequirementKind Kind, bool IsDependent,
195 bool ContainsUnexpandedParameterPack, bool IsSatisfied = true) :
196 Kind(Kind), Dependent(IsDependent),
197 ContainsUnexpandedParameterPack(ContainsUnexpandedParameterPack),
198 Satisfied(IsSatisfied) {}
199
200 RequirementKind getKind() const { return Kind; }
201
202 bool isSatisfied() const {
203 assert(!Dependent &&
204 "isSatisfied can only be called on non-dependent requirements.");
205 return Satisfied;
206 }
207
208 void setSatisfied(bool IsSatisfied) {
209 assert(!Dependent &&
210 "setSatisfied can only be called on non-dependent requirements.");
211 Satisfied = IsSatisfied;
212 }
213
214 void setDependent(bool IsDependent) { Dependent = IsDependent; }
215 bool isDependent() const { return Dependent; }
216
218 ContainsUnexpandedParameterPack = Contains;
219 }
221 return ContainsUnexpandedParameterPack;
222 }
223};
224
225/// \brief A requires-expression requirement which queries the existence of a
226/// type name or type template specialization ('type' requirements).
228public:
233 };
234private:
235 llvm::PointerUnion<SubstitutionDiagnostic *, TypeSourceInfo *> Value;
236 SatisfactionStatus Status;
237public:
240
241 /// \brief Construct a type requirement from a type. If the given type is not
242 /// dependent, this indicates that the type exists and the requirement will be
243 /// satisfied. Otherwise, the SubstitutionDiagnostic constructor is to be
244 /// used.
246
247 /// \brief Construct a type requirement when the nested name specifier is
248 /// invalid due to a bad substitution. The requirement is unsatisfied.
251 Status(SS_SubstitutionFailure) {}
252
253 SatisfactionStatus getSatisfactionStatus() const { return Status; }
255 this->Status = Status;
256 }
257
259 return Status == SS_SubstitutionFailure;
260 }
261
263 assert(Status == SS_SubstitutionFailure &&
264 "Attempted to get substitution diagnostic when there has been no "
265 "substitution failure.");
266 return cast<SubstitutionDiagnostic *>(Value);
267 }
268
270 assert(!isSubstitutionFailure() &&
271 "Attempted to get type when there has been a substitution failure.");
272 return cast<TypeSourceInfo *>(Value);
273 }
274
275 static bool classof(const Requirement *R) {
276 return R->getKind() == RK_Type;
277 }
278};
279
280/// \brief A requires-expression requirement which queries the validity and
281/// properties of an expression ('simple' and 'compound' requirements).
283public:
291 };
293 llvm::PointerIntPair<
294 llvm::PointerUnion<TemplateParameterList *, SubstitutionDiagnostic *>,
295 1, bool>
296 TypeConstraintInfo;
297 public:
300
301 /// \brief No return type requirement was specified.
302 ReturnTypeRequirement() : TypeConstraintInfo(nullptr, false) {}
303
304 /// \brief A return type requirement was specified but it was a
305 /// substitution failure.
307 TypeConstraintInfo(SubstDiag, false) {}
308
309 /// \brief A 'type constraint' style return type requirement.
310 /// \param TPL an invented template parameter list containing a single
311 /// type parameter with a type-constraint.
312 // TODO: Can we maybe not save the whole template parameter list and just
313 // the type constraint? Saving the whole TPL makes it easier to handle in
314 // serialization but is less elegant.
315 ReturnTypeRequirement(TemplateParameterList *TPL, bool IsDependent);
317
318 bool isDependent() const {
319 return TypeConstraintInfo.getInt();
320 }
321
323 if (!isTypeConstraint())
324 return false;
327 }
328
329 bool isEmpty() const {
330 return TypeConstraintInfo.getPointer().isNull();
331 }
332
334 return !isEmpty() &&
335 isa<SubstitutionDiagnostic *>(TypeConstraintInfo.getPointer());
336 }
337
338 bool isTypeConstraint() const {
339 return !isEmpty() &&
340 isa<TemplateParameterList *>(TypeConstraintInfo.getPointer());
341 }
342
344 assert(isSubstitutionFailure());
345 return cast<SubstitutionDiagnostic *>(TypeConstraintInfo.getPointer());
346 }
347
348 const TypeConstraint *getTypeConstraint() const;
349
351 assert(isTypeConstraint());
352 return cast<TemplateParameterList *>(TypeConstraintInfo.getPointer());
353 }
354 };
355private:
356 llvm::PointerUnion<Expr *, SubstitutionDiagnostic *> Value;
357 SourceLocation NoexceptLoc; // May be empty if noexcept wasn't specified.
358 ReturnTypeRequirement TypeReq;
359 ConceptSpecializationExpr *SubstitutedConstraintExpr;
360 SatisfactionStatus Status;
361public:
364
365 /// \brief Construct a compound requirement.
366 /// \param E the expression which is checked by this requirement.
367 /// \param IsSimple whether this was a simple requirement in source.
368 /// \param NoexceptLoc the location of the noexcept keyword, if it was
369 /// specified, otherwise an empty location.
370 /// \param Req the requirement for the type of the checked expression.
371 /// \param Status the satisfaction status of this requirement.
373 Expr *E, bool IsSimple, SourceLocation NoexceptLoc,
375 ConceptSpecializationExpr *SubstitutedConstraintExpr = nullptr);
376
377 /// \brief Construct a compound requirement whose expression was a
378 /// substitution failure. The requirement is not satisfied.
379 /// \param E the diagnostic emitted while instantiating the original
380 /// expression.
381 /// \param IsSimple whether this was a simple requirement in source.
382 /// \param NoexceptLoc the location of the noexcept keyword, if it was
383 /// specified, otherwise an empty location.
384 /// \param Req the requirement for the type of the checked expression (omit
385 /// if no requirement was specified).
387 SourceLocation NoexceptLoc, ReturnTypeRequirement Req = {});
388
389 bool isSimple() const { return getKind() == RK_Simple; }
390 bool isCompound() const { return getKind() == RK_Compound; }
391
392 bool hasNoexceptRequirement() const { return NoexceptLoc.isValid(); }
393 SourceLocation getNoexceptLoc() const { return NoexceptLoc; }
394
395 SatisfactionStatus getSatisfactionStatus() const { return Status; }
396
398 return Status == SS_ExprSubstitutionFailure;
399 }
400
402 return TypeReq;
403 }
404
408 return SubstitutedConstraintExpr;
409 }
410
412 assert(isExprSubstitutionFailure() &&
413 "Attempted to get expression substitution diagnostic when there has "
414 "been no expression substitution failure");
415 return cast<SubstitutionDiagnostic *>(Value);
416 }
417
418 Expr *getExpr() const {
419 assert(!isExprSubstitutionFailure() &&
420 "ExprRequirement has no expression because there has been a "
421 "substitution failure.");
422 return cast<Expr *>(Value);
423 }
424
425 static bool classof(const Requirement *R) {
426 return R->getKind() == RK_Compound || R->getKind() == RK_Simple;
427 }
428};
429
430/// \brief A requires-expression requirement which is satisfied when a general
431/// constraint expression is satisfied ('nested' requirements).
433 Expr *Constraint = nullptr;
434 const ASTConstraintSatisfaction *Satisfaction = nullptr;
435 bool HasInvalidConstraint = false;
436 StringRef InvalidConstraintEntity;
437
438public:
441
443 : Requirement(RK_Nested, /*IsDependent=*/true,
444 Constraint->containsUnexpandedParameterPack()),
445 Constraint(Constraint) {
446 assert(Constraint->isInstantiationDependent() &&
447 "Nested requirement with non-dependent constraint must be "
448 "constructed with a ConstraintSatisfaction object");
449 }
450
452 const ConstraintSatisfaction &Satisfaction)
453 : Requirement(RK_Nested, Constraint->isInstantiationDependent(),
455 Satisfaction.IsSatisfied),
456 Constraint(Constraint),
457 Satisfaction(ASTConstraintSatisfaction::Create(C, Satisfaction)) {}
458
459 NestedRequirement(StringRef InvalidConstraintEntity,
460 const ASTConstraintSatisfaction *Satisfaction)
462 /*IsDependent=*/false,
463 /*ContainsUnexpandedParameterPack*/ false,
464 Satisfaction->IsSatisfied),
465 Satisfaction(Satisfaction), HasInvalidConstraint(true),
466 InvalidConstraintEntity(InvalidConstraintEntity) {}
467
468 NestedRequirement(ASTContext &C, StringRef InvalidConstraintEntity,
469 const ConstraintSatisfaction &Satisfaction)
470 : NestedRequirement(InvalidConstraintEntity,
471 ASTConstraintSatisfaction::Create(C, Satisfaction)) {}
472
473 bool hasInvalidConstraint() const { return HasInvalidConstraint; }
474
476 assert(hasInvalidConstraint());
477 return InvalidConstraintEntity;
478 }
479
481 assert(!hasInvalidConstraint() &&
482 "getConstraintExpr() may not be called "
483 "on nested requirements with invalid constraint.");
484 return Constraint;
485 }
486
488 return *Satisfaction;
489 }
490
491 static bool classof(const Requirement *R) {
492 return R->getKind() == RK_Nested;
493 }
494};
495} // namespace concepts
496
497/// C++2a [expr.prim.req]:
498/// A requires-expression provides a concise way to express requirements on
499/// template arguments. A requirement is one that can be checked by name
500/// lookup (6.4) or by checking properties of types and expressions.
501/// [...]
502/// A requires-expression is a prvalue of type bool [...]
503class RequiresExpr final : public Expr,
504 llvm::TrailingObjects<RequiresExpr, ParmVarDecl *,
505 concepts::Requirement *> {
506 friend TrailingObjects;
507 friend class ASTStmtReader;
508
509 unsigned NumLocalParameters;
510 unsigned NumRequirements;
512 SourceLocation LParenLoc;
513 SourceLocation RParenLoc;
514 SourceLocation RBraceLoc;
515
516 unsigned numTrailingObjects(OverloadToken<ParmVarDecl *>) const {
517 return NumLocalParameters;
518 }
519
520 RequiresExpr(ASTContext &C, SourceLocation RequiresKWLoc,
521 RequiresExprBodyDecl *Body, SourceLocation LParenLoc,
522 ArrayRef<ParmVarDecl *> LocalParameters,
523 SourceLocation RParenLoc,
525 SourceLocation RBraceLoc);
526 RequiresExpr(ASTContext &C, EmptyShell Empty, unsigned NumLocalParameters,
527 unsigned NumRequirements);
528
529public:
530 static RequiresExpr *Create(ASTContext &C, SourceLocation RequiresKWLoc,
532 SourceLocation LParenLoc,
533 ArrayRef<ParmVarDecl *> LocalParameters,
534 SourceLocation RParenLoc,
536 SourceLocation RBraceLoc);
537 static RequiresExpr *
538 Create(ASTContext &C, EmptyShell Empty, unsigned NumLocalParameters,
539 unsigned NumRequirements);
540
542 return getTrailingObjects<ParmVarDecl *>(NumLocalParameters);
543 }
544
545 RequiresExprBodyDecl *getBody() const { return Body; }
546
548 return getTrailingObjects<concepts::Requirement *>(NumRequirements);
549 }
550
551 /// \brief Whether or not the requires clause is satisfied.
552 /// The expression must not be dependent.
553 bool isSatisfied() const {
554 assert(!isValueDependent()
555 && "isSatisfied called on a dependent RequiresExpr");
556 return RequiresExprBits.IsSatisfied;
557 }
558
559 void setSatisfied(bool IsSatisfied) {
560 assert(!isValueDependent() &&
561 "setSatisfied called on a dependent RequiresExpr");
562 RequiresExprBits.IsSatisfied = IsSatisfied;
563 }
564
566 return RequiresExprBits.RequiresKWLoc;
567 }
568
569 SourceLocation getLParenLoc() const { return LParenLoc; }
570 SourceLocation getRParenLoc() const { return RParenLoc; }
571 SourceLocation getRBraceLoc() const { return RBraceLoc; }
572
573 static bool classof(const Stmt *T) {
574 return T->getStmtClass() == RequiresExprClass;
575 }
576
577 SourceLocation getBeginLoc() const LLVM_READONLY {
578 return RequiresExprBits.RequiresKWLoc;
579 }
580 SourceLocation getEndLoc() const LLVM_READONLY {
581 return RBraceLoc;
582 }
583
584 // Iterators
587 }
590 }
591};
592
593} // namespace clang
594
595#endif // LLVM_CLANG_AST_EXPRCONCEPTS_H
This file provides AST data structures related to concepts.
Defines the clang::ASTContext interface.
Expr * E
Defines the C++ template declaration subclasses.
Defines the clang::SourceLocation class and associated facilities.
C Language Family Type Representation.
Holds long-lived AST nodes (such as types and decls) that can be referred to throughout the semantic ...
Definition: ASTContext.h:188
Reads an AST files chain containing the contents of a translation unit.
Definition: ASTReader.h:429
Declaration of a C++20 concept.
A reference to a concept and its template args, as it appears in the code.
Definition: ASTConcept.h:126
bool hasExplicitTemplateArgs() const
Whether or not template arguments were explicitly specified in the concept reference (they might not ...
Definition: ASTConcept.h:205
const NestedNameSpecifierLoc & getNestedNameSpecifierLoc() const
Definition: ASTConcept.h:166
NamedDecl * getFoundDecl() const
Definition: ASTConcept.h:193
const DeclarationNameInfo & getConceptNameInfo() const
Definition: ASTConcept.h:170
SourceLocation getConceptNameLoc() const
Definition: ASTConcept.h:172
SourceLocation getLocation() const
Definition: ASTConcept.h:178
SourceLocation getBeginLoc() const LLVM_READONLY
Definition: ASTConcept.cpp:96
const ASTTemplateArgumentListInfo * getTemplateArgsAsWritten() const
Definition: ASTConcept.h:199
SourceLocation getEndLoc() const LLVM_READONLY
Definition: ASTConcept.h:182
TemplateDecl * getNamedConcept() const
Definition: ASTConcept.h:197
SourceLocation getTemplateKWLoc() const
Definition: ASTConcept.h:176
Represents the specialization of a concept - evaluates to a prvalue of type bool.
Definition: ExprConcepts.h:42
SourceLocation getEndLoc() const LLVM_READONLY
Definition: ExprConcepts.h:149
SourceLocation getBeginLoc() const LLVM_READONLY
Definition: ExprConcepts.h:145
SourceLocation getExprLoc() const LLVM_READONLY
Definition: ExprConcepts.h:153
const_child_range children() const
Definition: ExprConcepts.h:161
bool isSatisfied() const
Whether or not the concept with the given arguments was satisfied when the expression was created.
Definition: ExprConcepts.h:126
ArrayRef< TemplateArgument > getTemplateArguments() const
Definition: ExprConcepts.h:81
const ASTTemplateArgumentListInfo * getTemplateArgsAsWritten() const
Definition: ExprConcepts.h:100
const NestedNameSpecifierLoc & getNestedNameSpecifierLoc() const
Definition: ExprConcepts.h:104
NamedDecl * getFoundDecl() const
Definition: ExprConcepts.h:112
static bool classof(const Stmt *T)
Definition: ExprConcepts.h:141
ConceptReference * getConceptReference() const
Definition: ExprConcepts.h:85
SourceLocation getConceptNameLoc() const
Definition: ExprConcepts.h:97
const ImplicitConceptSpecializationDecl * getSpecializationDecl() const
Definition: ExprConcepts.h:118
const DeclarationNameInfo & getConceptNameInfo() const
Definition: ExprConcepts.h:114
const ASTConstraintSatisfaction & getSatisfaction() const
Get elaborated satisfaction info about the template arguments' satisfaction of the named concept.
Definition: ExprConcepts.h:135
SourceLocation getTemplateKWLoc() const
Definition: ExprConcepts.h:108
ConceptDecl * getNamedConcept() const
Definition: ExprConcepts.h:87
The result of a constraint satisfaction check, containing the necessary information to diagnose an un...
Definition: ASTConcept.h:37
A little helper class (which is basically a smart pointer that forwards info from DiagnosticsEngine a...
Definition: Diagnostic.h:1548
This represents one expression.
Definition: Expr.h:112
bool isValueDependent() const
Determines whether the value of this expression depends on.
Definition: Expr.h:177
bool isInstantiationDependent() const
Whether this expression is instantiation-dependent, meaning that it depends in some way on.
Definition: Expr.h:223
ArrayRef< TemplateArgument > getTemplateArguments() const
This represents a decl that may have a name.
Definition: Decl.h:273
A C++ nested-name-specifier augmented with source location information.
Represents the body of a requires-expression.
Definition: DeclCXX.h:2098
C++2a [expr.prim.req]: A requires-expression provides a concise way to express requirements on templa...
Definition: ExprConcepts.h:505
SourceLocation getLParenLoc() const
Definition: ExprConcepts.h:569
SourceLocation getRParenLoc() const
Definition: ExprConcepts.h:570
SourceLocation getRBraceLoc() const
Definition: ExprConcepts.h:571
void setSatisfied(bool IsSatisfied)
Definition: ExprConcepts.h:559
SourceLocation getRequiresKWLoc() const
Definition: ExprConcepts.h:565
child_range children()
Definition: ExprConcepts.h:585
SourceLocation getEndLoc() const LLVM_READONLY
Definition: ExprConcepts.h:580
const_child_range children() const
Definition: ExprConcepts.h:588
RequiresExprBodyDecl * getBody() const
Definition: ExprConcepts.h:545
ArrayRef< concepts::Requirement * > getRequirements() const
Definition: ExprConcepts.h:547
bool isSatisfied() const
Whether or not the requires clause is satisfied.
Definition: ExprConcepts.h:553
SourceLocation getBeginLoc() const LLVM_READONLY
Definition: ExprConcepts.h:577
static bool classof(const Stmt *T)
Definition: ExprConcepts.h:573
ArrayRef< ParmVarDecl * > getLocalParameters() const
Definition: ExprConcepts.h:541
Encodes a location in the source.
bool isValid() const
Return true if this is a valid SourceLocation object.
Stmt - This represents one statement.
Definition: Stmt.h:85
StmtIterator child_iterator
Child Iterators: All subclasses must implement 'children' to permit easy iteration over the substatem...
Definition: Stmt.h:1558
llvm::iterator_range< child_iterator > child_range
Definition: Stmt.h:1561
RequiresExprBitfields RequiresExprBits
Definition: Stmt.h:1373
ConstStmtIterator const_child_iterator
Definition: Stmt.h:1559
llvm::iterator_range< const_child_iterator > const_child_range
Definition: Stmt.h:1562
Stores a list of template parameters for a TemplateDecl and its derived classes.
Definition: DeclTemplate.h:74
bool containsUnexpandedParameterPack() const
Determine whether this template parameter list contains an unexpanded parameter pack.
Models the abbreviated syntax to constrain a template type parameter: template <convertible_to<string...
Definition: ASTConcept.h:223
A container of type source information.
Definition: TypeBase.h:8314
ReturnTypeRequirement()
No return type requirement was specified.
Definition: ExprConcepts.h:302
TemplateParameterList * getTypeConstraintTemplateParameterList() const
Definition: ExprConcepts.h:350
SubstitutionDiagnostic * getSubstitutionDiagnostic() const
Definition: ExprConcepts.h:343
ReturnTypeRequirement(SubstitutionDiagnostic *SubstDiag)
A return type requirement was specified but it was a substitution failure.
Definition: ExprConcepts.h:306
A requires-expression requirement which queries the validity and properties of an expression ('simple...
Definition: ExprConcepts.h:282
SubstitutionDiagnostic * getExprSubstitutionDiagnostic() const
Definition: ExprConcepts.h:411
ConceptSpecializationExpr * getReturnTypeRequirementSubstitutedConstraintExpr() const
Definition: ExprConcepts.h:406
const ReturnTypeRequirement & getReturnTypeRequirement() const
Definition: ExprConcepts.h:401
SatisfactionStatus getSatisfactionStatus() const
Definition: ExprConcepts.h:395
SourceLocation getNoexceptLoc() const
Definition: ExprConcepts.h:393
static bool classof(const Requirement *R)
Definition: ExprConcepts.h:425
A requires-expression requirement which is satisfied when a general constraint expression is satisfie...
Definition: ExprConcepts.h:432
NestedRequirement(StringRef InvalidConstraintEntity, const ASTConstraintSatisfaction *Satisfaction)
Definition: ExprConcepts.h:459
static bool classof(const Requirement *R)
Definition: ExprConcepts.h:491
const ASTConstraintSatisfaction & getConstraintSatisfaction() const
Definition: ExprConcepts.h:487
NestedRequirement(ASTContext &C, StringRef InvalidConstraintEntity, const ConstraintSatisfaction &Satisfaction)
Definition: ExprConcepts.h:468
NestedRequirement(ASTContext &C, Expr *Constraint, const ConstraintSatisfaction &Satisfaction)
Definition: ExprConcepts.h:451
A static requirement that can be used in a requires-expression to check properties of types and expre...
Definition: ExprConcepts.h:170
void setSatisfied(bool IsSatisfied)
Definition: ExprConcepts.h:208
void setContainsUnexpandedParameterPack(bool Contains)
Definition: ExprConcepts.h:217
void setDependent(bool IsDependent)
Definition: ExprConcepts.h:214
RequirementKind getKind() const
Definition: ExprConcepts.h:200
bool containsUnexpandedParameterPack() const
Definition: ExprConcepts.h:220
Requirement(RequirementKind Kind, bool IsDependent, bool ContainsUnexpandedParameterPack, bool IsSatisfied=true)
Definition: ExprConcepts.h:194
A requires-expression requirement which queries the existence of a type name or type template special...
Definition: ExprConcepts.h:227
TypeRequirement(SubstitutionDiagnostic *Diagnostic)
Construct a type requirement when the nested name specifier is invalid due to a bad substitution.
Definition: ExprConcepts.h:249
static bool classof(const Requirement *R)
Definition: ExprConcepts.h:275
SubstitutionDiagnostic * getSubstitutionDiagnostic() const
Definition: ExprConcepts.h:262
TypeSourceInfo * getType() const
Definition: ExprConcepts.h:269
SatisfactionStatus getSatisfactionStatus() const
Definition: ExprConcepts.h:253
void setSatisfactionStatus(SatisfactionStatus Status)
Definition: ExprConcepts.h:254
The JSON file list parser is used to communicate input to InstallAPI.
@ Create
'create' clause, allowed on Compute and Combined constructs, plus 'data', 'enter data',...
@ Dependent
Parse the block as a dependent block, which may be used in some template instantiations but not other...
const FunctionProtoType * T
#define true
Definition: stdbool.h:25
#define false
Definition: stdbool.h:26
The result of a constraint satisfaction check, containing the necessary information to diagnose an un...
Definition: ASTConcept.h:91
Represents an explicit template argument list in C++, e.g., the "<int>" in "sort<int>".
Definition: TemplateBase.h:678
DeclarationNameInfo - A collector data type for bundling together a DeclarationName and the correspon...
A placeholder type used to construct an empty shell of a type, that will be filled in later (e....
Definition: Stmt.h:1412