clang 17.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/Support/ErrorHandling.h"
28#include "llvm/Support/TrailingObjects.h"
29#include <utility>
30#include <string>
31
32namespace clang {
33class ASTStmtReader;
34class ASTStmtWriter;
35
36/// \brief Represents the specialization of a concept - evaluates to a prvalue
37/// of type bool.
38///
39/// According to C++2a [expr.prim.id]p3 an id-expression that denotes the
40/// specialization of a concept results in a prvalue of type bool.
41class ConceptSpecializationExpr final : public Expr, public ConceptReference {
42 friend class ASTReader;
43 friend class ASTStmtReader;
44
45public:
46 using SubstitutionDiagnostic = std::pair<SourceLocation, std::string>;
47
48protected:
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.
57
60 DeclarationNameInfo ConceptNameInfo,
65
70 bool Dependent,
71 bool ContainsUnexpandedParameterPack);
73
74public:
82
87 const ConstraintSatisfaction *Satisfaction, bool Dependent,
88 bool ContainsUnexpandedParameterPack);
89
92 }
93
95 assert(SpecDecl && "Template Argument Decl not initialized");
96 return SpecDecl;
97 }
98
99 /// \brief Whether or not the concept with the given arguments was satisfied
100 /// when the expression was created.
101 /// The expression must not be dependent.
102 bool isSatisfied() const {
103 assert(!isValueDependent() &&
104 "isSatisfied called on a dependent ConceptSpecializationExpr");
106 }
107
108 /// \brief Get elaborated satisfaction info about the template arguments'
109 /// satisfaction of the named concept.
110 /// The expression must not be dependent.
112 assert(!isValueDependent() &&
113 "getSatisfaction called on dependent ConceptSpecializationExpr");
114 return *Satisfaction;
115 }
116
117 static bool classof(const Stmt *T) {
118 return T->getStmtClass() == ConceptSpecializationExprClass;
119 }
120
121 SourceLocation getBeginLoc() const LLVM_READONLY {
122 if (auto QualifierLoc = getNestedNameSpecifierLoc())
123 return QualifierLoc.getBeginLoc();
124 return ConceptName.getBeginLoc();
125 }
126
127 SourceLocation getEndLoc() const LLVM_READONLY {
128 // If the ConceptSpecializationExpr is the ImmediatelyDeclaredConstraint
129 // of a TypeConstraint written syntactically as a constrained-parameter,
130 // there may not be a template argument list.
133 }
134
135 // Iterators
138 }
141 }
142};
143
144namespace concepts {
145
146/// \brief A static requirement that can be used in a requires-expression to
147/// check properties of types and expression.
149public:
150 // Note - simple and compound requirements are both represented by the same
151 // class (ExprRequirement).
153private:
154 const RequirementKind Kind;
155 // FIXME: use RequirementDependence to model dependence?
156 bool Dependent : 1;
157 bool ContainsUnexpandedParameterPack : 1;
158 bool Satisfied : 1;
159public:
162 // FIXME: Store diagnostics semantically and not as prerendered strings.
163 // Fixing this probably requires serialization of PartialDiagnostic
164 // objects.
166 StringRef DiagMessage;
167 };
168
169 Requirement(RequirementKind Kind, bool IsDependent,
170 bool ContainsUnexpandedParameterPack, bool IsSatisfied = true) :
171 Kind(Kind), Dependent(IsDependent),
172 ContainsUnexpandedParameterPack(ContainsUnexpandedParameterPack),
173 Satisfied(IsSatisfied) {}
174
175 RequirementKind getKind() const { return Kind; }
176
177 bool isSatisfied() const {
178 assert(!Dependent &&
179 "isSatisfied can only be called on non-dependent requirements.");
180 return Satisfied;
181 }
182
183 void setSatisfied(bool IsSatisfied) {
184 assert(!Dependent &&
185 "setSatisfied can only be called on non-dependent requirements.");
186 Satisfied = IsSatisfied;
187 }
188
189 void setDependent(bool IsDependent) { Dependent = IsDependent; }
190 bool isDependent() const { return Dependent; }
191
193 ContainsUnexpandedParameterPack = Contains;
194 }
196 return ContainsUnexpandedParameterPack;
197 }
198};
199
200/// \brief A requires-expression requirement which queries the existence of a
201/// type name or type template specialization ('type' requirements).
203public:
208 };
209private:
210 llvm::PointerUnion<SubstitutionDiagnostic *, TypeSourceInfo *> Value;
211 SatisfactionStatus Status;
212public:
215
216 /// \brief Construct a type requirement from a type. If the given type is not
217 /// dependent, this indicates that the type exists and the requirement will be
218 /// satisfied. Otherwise, the SubstitutionDiagnostic constructor is to be
219 /// used.
221
222 /// \brief Construct a type requirement when the nested name specifier is
223 /// invalid due to a bad substitution. The requirement is unsatisfied.
226 Status(SS_SubstitutionFailure) {}
227
228 SatisfactionStatus getSatisfactionStatus() const { return Status; }
230 this->Status = Status;
231 }
232
234 return Status == SS_SubstitutionFailure;
235 }
236
238 assert(Status == SS_SubstitutionFailure &&
239 "Attempted to get substitution diagnostic when there has been no "
240 "substitution failure.");
241 return Value.get<SubstitutionDiagnostic *>();
242 }
243
245 assert(!isSubstitutionFailure() &&
246 "Attempted to get type when there has been a substitution failure.");
247 return Value.get<TypeSourceInfo *>();
248 }
249
250 static bool classof(const Requirement *R) {
251 return R->getKind() == RK_Type;
252 }
253};
254
255/// \brief A requires-expression requirement which queries the validity and
256/// properties of an expression ('simple' and 'compound' requirements).
258public:
266 };
268 llvm::PointerIntPair<
269 llvm::PointerUnion<TemplateParameterList *, SubstitutionDiagnostic *>,
270 1, bool>
271 TypeConstraintInfo;
272 public:
275
276 /// \brief No return type requirement was specified.
277 ReturnTypeRequirement() : TypeConstraintInfo(nullptr, false) {}
278
279 /// \brief A return type requirement was specified but it was a
280 /// substitution failure.
282 TypeConstraintInfo(SubstDiag, false) {}
283
284 /// \brief A 'type constraint' style return type requirement.
285 /// \param TPL an invented template parameter list containing a single
286 /// type parameter with a type-constraint.
287 // TODO: Can we maybe not save the whole template parameter list and just
288 // the type constraint? Saving the whole TPL makes it easier to handle in
289 // serialization but is less elegant.
291
292 bool isDependent() const {
293 return TypeConstraintInfo.getInt();
294 }
295
297 if (!isTypeConstraint())
298 return false;
301 }
302
303 bool isEmpty() const {
304 return TypeConstraintInfo.getPointer().isNull();
305 }
306
308 return !isEmpty() &&
309 TypeConstraintInfo.getPointer().is<SubstitutionDiagnostic *>();
310 }
311
312 bool isTypeConstraint() const {
313 return !isEmpty() &&
314 TypeConstraintInfo.getPointer().is<TemplateParameterList *>();
315 }
316
318 assert(isSubstitutionFailure());
319 return TypeConstraintInfo.getPointer().get<SubstitutionDiagnostic *>();
320 }
321
322 const TypeConstraint *getTypeConstraint() const;
323
325 assert(isTypeConstraint());
326 return TypeConstraintInfo.getPointer().get<TemplateParameterList *>();
327 }
328 };
329private:
330 llvm::PointerUnion<Expr *, SubstitutionDiagnostic *> Value;
331 SourceLocation NoexceptLoc; // May be empty if noexcept wasn't specified.
332 ReturnTypeRequirement TypeReq;
333 ConceptSpecializationExpr *SubstitutedConstraintExpr;
334 SatisfactionStatus Status;
335public:
338
339 /// \brief Construct a compound requirement.
340 /// \param E the expression which is checked by this requirement.
341 /// \param IsSimple whether this was a simple requirement in source.
342 /// \param NoexceptLoc the location of the noexcept keyword, if it was
343 /// specified, otherwise an empty location.
344 /// \param Req the requirement for the type of the checked expression.
345 /// \param Status the satisfaction status of this requirement.
347 Expr *E, bool IsSimple, SourceLocation NoexceptLoc,
349 ConceptSpecializationExpr *SubstitutedConstraintExpr = nullptr);
350
351 /// \brief Construct a compound requirement whose expression was a
352 /// substitution failure. The requirement is not satisfied.
353 /// \param E the diagnostic emitted while instantiating the original
354 /// expression.
355 /// \param IsSimple whether this was a simple requirement in source.
356 /// \param NoexceptLoc the location of the noexcept keyword, if it was
357 /// specified, otherwise an empty location.
358 /// \param Req the requirement for the type of the checked expression (omit
359 /// if no requirement was specified).
360 ExprRequirement(SubstitutionDiagnostic *E, bool IsSimple,
361 SourceLocation NoexceptLoc, ReturnTypeRequirement Req = {});
362
363 bool isSimple() const { return getKind() == RK_Simple; }
364 bool isCompound() const { return getKind() == RK_Compound; }
365
366 bool hasNoexceptRequirement() const { return NoexceptLoc.isValid(); }
367 SourceLocation getNoexceptLoc() const { return NoexceptLoc; }
368
369 SatisfactionStatus getSatisfactionStatus() const { return Status; }
370
372 return Status == SS_ExprSubstitutionFailure;
373 }
374
376 return TypeReq;
377 }
378
382 return SubstitutedConstraintExpr;
383 }
384
386 assert(isExprSubstitutionFailure() &&
387 "Attempted to get expression substitution diagnostic when there has "
388 "been no expression substitution failure");
389 return Value.get<SubstitutionDiagnostic *>();
390 }
391
392 Expr *getExpr() const {
393 assert(!isExprSubstitutionFailure() &&
394 "ExprRequirement has no expression because there has been a "
395 "substitution failure.");
396 return Value.get<Expr *>();
397 }
398
399 static bool classof(const Requirement *R) {
400 return R->getKind() == RK_Compound || R->getKind() == RK_Simple;
401 }
402};
403
404/// \brief A requires-expression requirement which is satisfied when a general
405/// constraint expression is satisfied ('nested' requirements).
407 Expr *Constraint = nullptr;
408 const ASTConstraintSatisfaction *Satisfaction = nullptr;
409 bool HasInvalidConstraint = false;
410 StringRef InvalidConstraintEntity;
411
412public:
415
417 : Requirement(RK_Nested, /*IsDependent=*/true,
418 Constraint->containsUnexpandedParameterPack()),
419 Constraint(Constraint) {
420 assert(Constraint->isInstantiationDependent() &&
421 "Nested requirement with non-dependent constraint must be "
422 "constructed with a ConstraintSatisfaction object");
423 }
424
426 const ConstraintSatisfaction &Satisfaction)
427 : Requirement(RK_Nested, Constraint->isInstantiationDependent(),
429 Satisfaction.IsSatisfied),
430 Constraint(Constraint),
431 Satisfaction(ASTConstraintSatisfaction::Create(C, Satisfaction)) {}
432
433 NestedRequirement(StringRef InvalidConstraintEntity,
434 const ASTConstraintSatisfaction *Satisfaction)
436 /*IsDependent=*/false,
437 /*ContainsUnexpandedParameterPack*/ false,
438 Satisfaction->IsSatisfied),
439 Satisfaction(Satisfaction), HasInvalidConstraint(true),
440 InvalidConstraintEntity(InvalidConstraintEntity) {}
441
442 NestedRequirement(ASTContext &C, StringRef InvalidConstraintEntity,
443 const ConstraintSatisfaction &Satisfaction)
444 : NestedRequirement(InvalidConstraintEntity,
445 ASTConstraintSatisfaction::Create(C, Satisfaction)) {}
446
447 bool hasInvalidConstraint() const { return HasInvalidConstraint; }
448
450 assert(hasInvalidConstraint());
451 return InvalidConstraintEntity;
452 }
453
455 assert(!hasInvalidConstraint() &&
456 "getConstraintExpr() may not be called "
457 "on nested requirements with invalid constraint.");
458 return Constraint;
459 }
460
462 return *Satisfaction;
463 }
464
465 static bool classof(const Requirement *R) {
466 return R->getKind() == RK_Nested;
467 }
468};
469
470} // namespace concepts
471
472/// C++2a [expr.prim.req]:
473/// A requires-expression provides a concise way to express requirements on
474/// template arguments. A requirement is one that can be checked by name
475/// lookup (6.4) or by checking properties of types and expressions.
476/// [...]
477/// A requires-expression is a prvalue of type bool [...]
478class RequiresExpr final : public Expr,
479 llvm::TrailingObjects<RequiresExpr, ParmVarDecl *,
480 concepts::Requirement *> {
481 friend TrailingObjects;
482 friend class ASTStmtReader;
483
484 unsigned NumLocalParameters;
485 unsigned NumRequirements;
487 SourceLocation RBraceLoc;
488
489 unsigned numTrailingObjects(OverloadToken<ParmVarDecl *>) const {
490 return NumLocalParameters;
491 }
492
493 unsigned numTrailingObjects(OverloadToken<concepts::Requirement *>) const {
494 return NumRequirements;
495 }
496
497 RequiresExpr(ASTContext &C, SourceLocation RequiresKWLoc,
498 RequiresExprBodyDecl *Body,
499 ArrayRef<ParmVarDecl *> LocalParameters,
500 ArrayRef<concepts::Requirement *> Requirements,
501 SourceLocation RBraceLoc);
502 RequiresExpr(ASTContext &C, EmptyShell Empty, unsigned NumLocalParameters,
503 unsigned NumRequirements);
504
505public:
506 static RequiresExpr *
507 Create(ASTContext &C, SourceLocation RequiresKWLoc,
508 RequiresExprBodyDecl *Body, ArrayRef<ParmVarDecl *> LocalParameters,
509 ArrayRef<concepts::Requirement *> Requirements,
510 SourceLocation RBraceLoc);
511 static RequiresExpr *
512 Create(ASTContext &C, EmptyShell Empty, unsigned NumLocalParameters,
513 unsigned NumRequirements);
514
516 return {getTrailingObjects<ParmVarDecl *>(), NumLocalParameters};
517 }
518
519 RequiresExprBodyDecl *getBody() const { return Body; }
520
522 return {getTrailingObjects<concepts::Requirement *>(), NumRequirements};
523 }
524
525 /// \brief Whether or not the requires clause is satisfied.
526 /// The expression must not be dependent.
527 bool isSatisfied() const {
528 assert(!isValueDependent()
529 && "isSatisfied called on a dependent RequiresExpr");
530 return RequiresExprBits.IsSatisfied;
531 }
532
533 void setSatisfied(bool IsSatisfied) {
534 assert(!isValueDependent() &&
535 "setSatisfied called on a dependent RequiresExpr");
536 RequiresExprBits.IsSatisfied = IsSatisfied;
537 }
538
540 return RequiresExprBits.RequiresKWLoc;
541 }
542
543 SourceLocation getRBraceLoc() const { return RBraceLoc; }
544
545 static bool classof(const Stmt *T) {
546 return T->getStmtClass() == RequiresExprClass;
547 }
548
549 SourceLocation getBeginLoc() const LLVM_READONLY {
550 return RequiresExprBits.RequiresKWLoc;
551 }
552 SourceLocation getEndLoc() const LLVM_READONLY {
553 return RBraceLoc;
554 }
555
556 // Iterators
559 }
562 }
563};
564
565} // namespace clang
566
567#endif // LLVM_CLANG_AST_EXPRCONCEPTS_H
This file provides AST data structures related to concepts.
Defines the clang::ASTContext interface.
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:182
Reads an AST files chain containing the contents of a translation unit.
Definition: ASTReader.h:366
Declaration of a C++20 concept.
Common data class for constructs that reference concepts with template arguments.
Definition: ASTConcept.h:112
DeclarationNameInfo ConceptName
The concept name used.
Definition: ASTConcept.h:122
ConceptDecl * NamedConcept
The concept named.
Definition: ASTConcept.h:131
const NestedNameSpecifierLoc & getNestedNameSpecifierLoc() const
Definition: ASTConcept.h:149
SourceLocation TemplateKWLoc
The location of the template keyword, if specified when naming the concept.
Definition: ASTConcept.h:119
const ASTTemplateArgumentListInfo * ArgsAsWritten
The template argument list source info used to specialize the concept.
Definition: ASTConcept.h:135
NamedDecl * FoundDecl
The declaration found by name lookup when the expression was created.
Definition: ASTConcept.h:128
Represents the specialization of a concept - evaluates to a prvalue of type bool.
Definition: ExprConcepts.h:41
SourceLocation getEndLoc() const LLVM_READONLY
Definition: ExprConcepts.h:127
SourceLocation getBeginLoc() const LLVM_READONLY
Definition: ExprConcepts.h:121
const_child_range children() const
Definition: ExprConcepts.h:139
bool isSatisfied() const
Whether or not the concept with the given arguments was satisfied when the expression was created.
Definition: ExprConcepts.h:102
ArrayRef< TemplateArgument > getTemplateArguments() const
Definition: ExprConcepts.h:90
std::pair< SourceLocation, std::string > SubstitutionDiagnostic
Definition: ExprConcepts.h:46
ASTConstraintSatisfaction * Satisfaction
Information about the satisfaction of the named concept with the given arguments.
Definition: ExprConcepts.h:56
static bool classof(const Stmt *T)
Definition: ExprConcepts.h:117
static ConceptSpecializationExpr * Create(const ASTContext &C, NestedNameSpecifierLoc NNS, SourceLocation TemplateKWLoc, DeclarationNameInfo ConceptNameInfo, NamedDecl *FoundDecl, ConceptDecl *NamedConcept, const ASTTemplateArgumentListInfo *ArgsAsWritten, ImplicitConceptSpecializationDecl *SpecDecl, const ConstraintSatisfaction *Satisfaction)
const ImplicitConceptSpecializationDecl * getSpecializationDecl() const
Definition: ExprConcepts.h:94
const ASTConstraintSatisfaction & getSatisfaction() const
Get elaborated satisfaction info about the template arguments' satisfaction of the named concept.
Definition: ExprConcepts.h:111
ImplicitConceptSpecializationDecl * SpecDecl
The Implicit Concept Specialization Decl, which holds the template arguments for this specialization.
Definition: ExprConcepts.h:51
The result of a constraint satisfaction check, containing the necessary information to diagnose an un...
Definition: ASTConcept.h:28
A little helper class (which is basically a smart pointer that forwards info from DiagnosticsEngine) ...
Definition: Diagnostic.h:1566
This represents one expression.
Definition: Expr.h:110
bool isValueDependent() const
Determines whether the value of this expression depends on.
Definition: Expr.h:169
bool isInstantiationDependent() const
Whether this expression is instantiation-dependent, meaning that it depends in some way on.
Definition: Expr.h:215
ArrayRef< TemplateArgument > getTemplateArguments() const
This represents a decl that may have a name.
Definition: Decl.h:247
A C++ nested-name-specifier augmented with source location information.
Represents the body of a requires-expression.
Definition: DeclCXX.h:2013
C++2a [expr.prim.req]: A requires-expression provides a concise way to express requirements on templa...
Definition: ExprConcepts.h:480
static RequiresExpr * Create(ASTContext &C, SourceLocation RequiresKWLoc, RequiresExprBodyDecl *Body, ArrayRef< ParmVarDecl * > LocalParameters, ArrayRef< concepts::Requirement * > Requirements, SourceLocation RBraceLoc)
SourceLocation getRBraceLoc() const
Definition: ExprConcepts.h:543
void setSatisfied(bool IsSatisfied)
Definition: ExprConcepts.h:533
SourceLocation getRequiresKWLoc() const
Definition: ExprConcepts.h:539
child_range children()
Definition: ExprConcepts.h:557
SourceLocation getEndLoc() const LLVM_READONLY
Definition: ExprConcepts.h:552
const_child_range children() const
Definition: ExprConcepts.h:560
RequiresExprBodyDecl * getBody() const
Definition: ExprConcepts.h:519
ArrayRef< concepts::Requirement * > getRequirements() const
Definition: ExprConcepts.h:521
bool isSatisfied() const
Whether or not the requires clause is satisfied.
Definition: ExprConcepts.h:527
SourceLocation getBeginLoc() const LLVM_READONLY
Definition: ExprConcepts.h:549
static bool classof(const Stmt *T)
Definition: ExprConcepts.h:545
ArrayRef< ParmVarDecl * > getLocalParameters() const
Definition: ExprConcepts.h:515
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:72
StmtIterator child_iterator
Child Iterators: All subclasses must implement 'children' to permit easy iteration over the substatem...
Definition: Stmt.h:1267
StmtClass getStmtClass() const
Definition: Stmt.h:1181
llvm::iterator_range< child_iterator > child_range
Definition: Stmt.h:1270
RequiresExprBitfields RequiresExprBits
Definition: Stmt.h:1087
ConstStmtIterator const_child_iterator
Definition: Stmt.h:1268
llvm::iterator_range< const_child_iterator > const_child_range
Definition: Stmt.h:1271
Stores a list of template parameters for a TemplateDecl and its derived classes.
Definition: DeclTemplate.h:73
bool containsUnexpandedParameterPack() const
Determine whether this template parameter list contains an unexpanded parameter pack.
A container of type source information.
Definition: Type.h:6635
ReturnTypeRequirement()
No return type requirement was specified.
Definition: ExprConcepts.h:277
TemplateParameterList * getTypeConstraintTemplateParameterList() const
Definition: ExprConcepts.h:324
SubstitutionDiagnostic * getSubstitutionDiagnostic() const
Definition: ExprConcepts.h:317
ReturnTypeRequirement(SubstitutionDiagnostic *SubstDiag)
A return type requirement was specified but it was a substitution failure.
Definition: ExprConcepts.h:281
A requires-expression requirement which queries the validity and properties of an expression ('simple...
Definition: ExprConcepts.h:257
SubstitutionDiagnostic * getExprSubstitutionDiagnostic() const
Definition: ExprConcepts.h:385
ConceptSpecializationExpr * getReturnTypeRequirementSubstitutedConstraintExpr() const
Definition: ExprConcepts.h:380
const ReturnTypeRequirement & getReturnTypeRequirement() const
Definition: ExprConcepts.h:375
SatisfactionStatus getSatisfactionStatus() const
Definition: ExprConcepts.h:369
SourceLocation getNoexceptLoc() const
Definition: ExprConcepts.h:367
static bool classof(const Requirement *R)
Definition: ExprConcepts.h:399
A requires-expression requirement which is satisfied when a general constraint expression is satisfie...
Definition: ExprConcepts.h:406
NestedRequirement(StringRef InvalidConstraintEntity, const ASTConstraintSatisfaction *Satisfaction)
Definition: ExprConcepts.h:433
static bool classof(const Requirement *R)
Definition: ExprConcepts.h:465
const ASTConstraintSatisfaction & getConstraintSatisfaction() const
Definition: ExprConcepts.h:461
NestedRequirement(ASTContext &C, StringRef InvalidConstraintEntity, const ConstraintSatisfaction &Satisfaction)
Definition: ExprConcepts.h:442
NestedRequirement(ASTContext &C, Expr *Constraint, const ConstraintSatisfaction &Satisfaction)
Definition: ExprConcepts.h:425
A static requirement that can be used in a requires-expression to check properties of types and expre...
Definition: ExprConcepts.h:148
void setSatisfied(bool IsSatisfied)
Definition: ExprConcepts.h:183
void setContainsUnexpandedParameterPack(bool Contains)
Definition: ExprConcepts.h:192
void setDependent(bool IsDependent)
Definition: ExprConcepts.h:189
RequirementKind getKind() const
Definition: ExprConcepts.h:175
bool containsUnexpandedParameterPack() const
Definition: ExprConcepts.h:195
Requirement(RequirementKind Kind, bool IsDependent, bool ContainsUnexpandedParameterPack, bool IsSatisfied=true)
Definition: ExprConcepts.h:169
A requires-expression requirement which queries the existence of a type name or type template special...
Definition: ExprConcepts.h:202
TypeRequirement(SubstitutionDiagnostic *Diagnostic)
Construct a type requirement when the nested name specifier is invalid due to a bad substitution.
Definition: ExprConcepts.h:224
static bool classof(const Requirement *R)
Definition: ExprConcepts.h:250
SubstitutionDiagnostic * getSubstitutionDiagnostic() const
Definition: ExprConcepts.h:237
TypeSourceInfo * getType() const
Definition: ExprConcepts.h:244
SatisfactionStatus getSatisfactionStatus() const
Definition: ExprConcepts.h:228
void setSatisfactionStatus(SatisfactionStatus Status)
Definition: ExprConcepts.h:229
@ C
Languages that the frontend can parse and compile.
#define true
Definition: stdbool.h:21
#define false
Definition: stdbool.h:22
The result of a constraint satisfaction check, containing the necessary information to diagnose an un...
Definition: ASTConcept.h:86
Represents an explicit template argument list in C++, e.g., the "<int>" in "sort<int>".
Definition: TemplateBase.h:641
SourceLocation RAngleLoc
The source location of the right angle bracket ('>').
Definition: TemplateBase.h:656
DeclarationNameInfo - A collector data type for bundling together a DeclarationName and the correspon...
SourceLocation getBeginLoc() const
getBeginLoc - Retrieve the location of the first token.
SourceLocation getEndLoc() const LLVM_READONLY
A placeholder type used to construct an empty shell of a type, that will be filled in later (e....
Definition: Stmt.h:1121