23 using namespace clang;
31 class CollectUnexpandedParameterPacksVisitor :
42 explicit CollectUnexpandedParameterPacksVisitor(
44 : Unexpanded(Unexpanded), InLambda(
false) { }
46 bool shouldWalkTypesOfTypeLocs()
const {
return false; }
83 = dyn_cast_or_null<TemplateTemplateParmDecl>(
85 if (TTP->isParameterPack())
88 return inherited::TraverseTemplateName(Template);
102 TraverseStmt(Element.
Key);
103 TraverseStmt(Element.
Value);
113 bool TraverseStmt(
Stmt *
S) {
114 Expr *E = dyn_cast_or_null<Expr>(
S);
116 return inherited::TraverseStmt(S);
125 return inherited::TraverseType(T);
132 bool TraverseTypeLoc(
TypeLoc TL) {
136 return inherited::TraverseTypeLoc(TL);
143 bool TraverseDecl(
Decl *D) {
144 if ((D && isa<ParmVarDecl>(D)) || InLambda)
145 return inherited::TraverseDecl(D);
155 return inherited::TraverseTemplateArgument(Arg);
163 return inherited::TraverseTemplateArgumentLoc(ArgLoc);
177 bool WasInLambda = InLambda;
185 if (
I->capturesVariable()) {
188 Unexpanded.push_back(std::make_pair(VD,
I->getLocation()));
192 inherited::TraverseLambdaExpr(Lambda);
194 InLambda = WasInLambda;
209 if (isa<sema::LambdaScopeInfo>(SI))
220 if (Unexpanded.empty())
230 LSI->ContainsUnexpandedParameterPack =
true;
237 llvm::SmallPtrSet<IdentifierInfo *, 4> NamesKnown;
239 for (
unsigned I = 0, N = Unexpanded.size();
I != N; ++
I) {
243 Name = TTP->getIdentifier();
247 if (Name && NamesKnown.insert(Name).second)
248 Names.push_back(Name);
250 if (Unexpanded[
I].second.isValid())
251 Locations.push_back(Unexpanded[
I].second);
255 << (int)UPPC << (
int)Names.size();
259 for (
unsigned I = 0, N = Locations.size();
I != N; ++
I)
274 CollectUnexpandedParameterPacksVisitor(Unexpanded).TraverseTypeLoc(
276 assert(!Unexpanded.empty() &&
"Unable to find unexpanded parameter packs");
289 CollectUnexpandedParameterPacksVisitor(Unexpanded).TraverseStmt(E);
290 assert(!Unexpanded.empty() &&
"Unable to find unexpanded parameter packs");
304 CollectUnexpandedParameterPacksVisitor(Unexpanded)
306 assert(!Unexpanded.empty() &&
"Unable to find unexpanded parameter packs");
341 CollectUnexpandedParameterPacksVisitor(Unexpanded)
343 assert(!Unexpanded.empty() &&
"Unable to find unexpanded parameter packs");
355 CollectUnexpandedParameterPacksVisitor(Unexpanded)
356 .TraverseTemplateName(Template);
357 assert(!Unexpanded.empty() &&
"Unable to find unexpanded parameter packs");
368 CollectUnexpandedParameterPacksVisitor(Unexpanded)
369 .TraverseTemplateArgumentLoc(Arg);
370 assert(!Unexpanded.empty() &&
"Unable to find unexpanded parameter packs");
376 CollectUnexpandedParameterPacksVisitor(Unexpanded)
377 .TraverseTemplateArgument(Arg);
382 CollectUnexpandedParameterPacksVisitor(Unexpanded)
383 .TraverseTemplateArgumentLoc(Arg);
388 CollectUnexpandedParameterPacksVisitor(Unexpanded).TraverseType(T);
393 CollectUnexpandedParameterPacksVisitor(Unexpanded).TraverseTypeLoc(TL);
399 CollectUnexpandedParameterPacksVisitor(Unexpanded)
400 .TraverseNestedNameSpecifierLoc(NNS);
406 CollectUnexpandedParameterPacksVisitor(Unexpanded)
407 .TraverseDeclarationNameInfo(NameInfo);
441 Diag(EllipsisLoc, diag::err_pack_expansion_without_parameter_packs)
448 llvm_unreachable(
"Unhandled template argument kind?");
471 EllipsisLoc, NumExpansions);
491 Diag(EllipsisLoc, diag::err_pack_expansion_without_parameter_packs)
513 Diag(EllipsisLoc, diag::err_pack_expansion_without_parameter_packs)
524 static std::pair<unsigned, unsigned>
527 return std::make_pair(TTP->getDepth(), TTP->getIndex());
530 return std::make_pair(NTTP->getDepth(), NTTP->getIndex());
542 RetainExpansion =
false;
543 std::pair<IdentifierInfo *, SourceLocation> FirstPack;
544 bool HaveFirstPack =
false;
547 end = Unexpanded.end();
550 unsigned Depth = 0, Index = 0;
552 bool IsFunctionParameterPack =
false;
556 Depth = TTP->getDepth();
557 Index = TTP->getIndex();
558 Name = TTP->getIdentifier();
561 if (isa<ParmVarDecl>(ND))
562 IsFunctionParameterPack =
true;
570 unsigned NewPackSize;
571 if (IsFunctionParameterPack) {
575 llvm::PointerUnion<Decl *, DeclArgumentPack *> *Instantiation
578 if (Instantiation->is<DeclArgumentPack *>()) {
580 NewPackSize = Instantiation->get<DeclArgumentPack *>()->size();
584 ShouldExpand =
false;
593 ShouldExpand =
false;
598 NewPackSize = TemplateArgs(Depth, Index).pack_size();
608 unsigned PartialDepth, PartialIndex;
610 if (PartialDepth == Depth && PartialIndex == Index)
611 RetainExpansion =
true;
615 if (!NumExpansions) {
618 NumExpansions = NewPackSize;
619 FirstPack.first =
Name;
620 FirstPack.second = i->second;
621 HaveFirstPack =
true;
625 if (NewPackSize != *NumExpansions) {
630 Diag(EllipsisLoc, diag::err_pack_expansion_length_conflict)
631 << FirstPack.first << Name << *NumExpansions << NewPackSize
634 Diag(EllipsisLoc, diag::err_pack_expansion_length_conflict_multilevel)
635 << Name << *NumExpansions << NewPackSize
636 << SourceRange(i->second);
646 QualType Pattern = cast<PackExpansionType>(T)->getPattern();
648 CollectUnexpandedParameterPacksVisitor(Unexpanded).TraverseType(Pattern);
651 for (
unsigned I = 0, N = Unexpanded.size();
I != N; ++
I) {
658 Depth = TTP->getDepth();
659 Index = TTP->getIndex();
662 if (isa<ParmVarDecl>(ND)) {
666 llvm::PointerUnion<Decl *, DeclArgumentPack *> *Instantiation
669 if (Instantiation->is<
Decl*>())
674 unsigned Size = Instantiation->get<DeclArgumentPack *>()->size();
675 assert((!Result || *Result == Size) &&
"inconsistent pack sizes");
689 unsigned Size = TemplateArgs(Depth, Index).pack_size();
690 assert((!Result || *Result == Size) &&
"inconsistent pack sizes");
741 #define GENERIC_IMAGE_TYPE(ImgType, Id) case TST_##ImgType##_t:
742 #include "clang/Basic/OpenCLImageTypes.def"
750 switch (Chunk.
Kind) {
765 for (
unsigned i = 0, e = Chunk.
Fun.
NumParams; i != e; ++i) {
768 assert(!ParamTy.isNull() &&
"Couldn't parse type?");
769 if (ParamTy->containsUnexpandedParameterPack())
return true;
806 bool ValidateCandidate(
const TypoCorrection &candidate)
override {
848 llvm::make_unique<ParameterPackValidatorCCC>(),
851 PDiag(diag::err_sizeof_pack_no_pack_name_suggest) << &Name,
852 PDiag(diag::note_parameter_pack_here));
853 ParameterPack = Corrected.getCorrectionDecl();
866 Diag(NameLoc, diag::err_sizeof_pack_no_pack_name)
888 if (!ExpansionTSInfo)
911 = cast<PackExpansionExpr>(Argument.
getAsExpr());
934 llvm_unreachable(
"Invalid TemplateArgument Kind!");
949 Pack =
Subst->getArgumentPack();
956 dyn_cast<SubstNonTypeTemplateParmPackExpr>(Arg.
getAsExpr()))
957 Pack =
Subst->getArgumentPack();
958 else if (
auto *
Subst = dyn_cast<FunctionParmPackExpr>(Arg.
getAsExpr())) {
960 if (PD->isParameterPack())
962 return Subst->getNumExpansions();
970 Pack =
Subst->getArgumentPack();
988 if (Elem.isPackExpansion())
991 return Pack.pack_size();
1000 if ((OCE && OCE->isInfixBinaryOp()) || isa<BinaryOperator>(E) ||
1001 isa<AbstractConditionalOperator>(
E)) {
1018 auto DiscardOperands = [&] {
1031 return Diag(EllipsisLoc,
1033 ? diag::err_fold_expression_packs_both_sides
1034 : diag::err_pack_expansion_without_parameter_packs)
1042 Expr *Pack = LHS ? LHS : RHS;
1043 assert(Pack &&
"fold expression with neither LHS nor RHS");
1046 return Diag(EllipsisLoc, diag::err_pack_expansion_without_parameter_packs)
1059 Operator, EllipsisLoc, RHS, RParenLoc);
1084 return Diag(EllipsisLoc, diag::err_fold_expression_empty)
A call to an overloaded operator written using operator syntax.
ParsedType CreateParsedType(QualType T, TypeSourceInfo *TInfo)
Package the given type and TSI into a ParsedType.
Name lookup found a set of overloaded functions that met the criteria.
UnexpandedParameterPackContext
The context in which an unexpanded parameter pack is being diagnosed.
TemplateArgument getPackExpansionPattern() const
When the template argument is a pack expansion, returns the pattern of the pack expansion.
bool containsUnexpandedParameterPack() const
Whether this nested-name-specifier contains an unexpanded parameter pack (for C++11 variadic template...
A (possibly-)qualified type.
Simple class containing the result of Sema::CorrectTypo.
bool containsUnexpandedParameterPack() const
Whether this expression contains an unexpanded parameter pack (for C++11 variadic templates)...
__SIZE_TYPE__ size_t
The unsigned integer type of the result of the sizeof operator.
Ordinary name lookup, which finds ordinary names (functions, variables, typedefs, etc...
IdentifierInfo * getIdentifier() const
getIdentifier - Get the identifier that names this declaration, if there is one.
static std::pair< unsigned, unsigned > getDepthAndIndex(NamedDecl *ND)
Retrieve the depth and index of a parameter pack.
bool LookupName(LookupResult &R, Scope *S, bool AllowBuiltinCreation=false)
Perform unqualified name lookup starting from a given scope.
ParsedType getAsType() const
Retrieve the template type argument's type.
Stmt - This represents one statement.
TemplateDecl * getAsTemplateDecl() const
Retrieve the underlying template declaration that this template name refers to, if known...
The template argument is an expression, and we've not resolved it to one of the other forms yet...
ArrayRef< TemplateArgument > pack_elements() const
Iterator range referencing all of the elements of a template argument pack.
bool hasTemplateArgument(unsigned Depth, unsigned Index) const
Determine whether there is a non-NULL template argument at the given depth and index.
SemaDiagnosticBuilder Diag(SourceLocation Loc, unsigned DiagID)
Emit a diagnostic.
Decl - This represents one declaration (or definition), e.g.
TypeLoc getPatternLoc() const
llvm::PointerUnion< Decl *, DeclArgumentPack * > * findInstantiationOf(const Decl *D)
Find the instantiation of the declaration D within the current instantiation scope.
The base class of the type hierarchy.
One instance of this struct is used for each type in a declarator that is parsed. ...
The template argument is a declaration that was provided for a pointer, reference, or pointer to member non-type template parameter.
A container of type source information.
Expr * getAsExpr() const
Retrieve the template argument as an expression.
Describes the capture of a variable or of this, or of a C++1y init-capture.
capture_iterator capture_begin() const
Retrieve an iterator pointing to the first lambda capture.
ParsedType getTrailingReturnType() const
Get the trailing-return-type for this function declarator.
ObjCDictionaryElement getKeyValueElement(unsigned Index) const
VarDecl - An instance of this class is created to represent a variable declaration or definition...
PartialDiagnostic PDiag(unsigned DiagID=0)
Build a partial diagnostic.
Information about one declarator, including the parsed type information and the identifier.
Represents an empty template argument, e.g., one that has not been deduced.
SourceLocation getLocation() const
Retrieve the location of the template argument.
void setBegin(SourceLocation b)
bool containsUnexpandedParameterPack() const
Whether this type is or contains an unexpanded parameter pack, used to support C++0x variadic templat...
ParmVarDecl - Represents a parameter to a function.
SourceLocation getLocation() const
bool isPackExpansion() const
Determine whether this template argument is a pack expansion.
Base wrapper for a particular "section" of type source info.
Expr * IgnoreImpCasts() LLVM_READONLY
IgnoreImpCasts - Skip past any implicit casts which might surround this expression.
Expr * NoexceptExpr
Pointer to the expression in the noexcept-specifier of this function, if it has one.
DeclarationName getName() const
getName - Returns the embedded declaration name.
One of these records is kept for each identifier that is lexed.
LocalInstantiationScope * CurrentInstantiationScope
The current instantiation scope used to store local variables.
Name lookup results in an ambiguity; use getAmbiguityKind to figure out what kind of ambiguity we hav...
An element in an Objective-C dictionary literal.
A C++ nested-name-specifier augmented with source location information.
The template argument is an integral value stored in an llvm::APSInt that was provided for an integra...
Base class for callback objects used by Sema::CorrectTypo to check the validity of a potential typo c...
TypeSourceInfo * getTypeSourceInfo(ASTContext &Context, QualType T)
Creates a TypeSourceInfo for the given type.
SourceLocation getLocation() const
Fetches the primary location of the argument.
Represents the result of substituting a set of types for a template type parameter pack...
A non-type template parameter, stored as an expression.
bool CheckParameterPacksForExpansion(SourceLocation EllipsisLoc, SourceRange PatternRange, ArrayRef< UnexpandedParameterPack > Unexpanded, const MultiLevelTemplateArgumentList &TemplateArgs, bool &ShouldExpand, bool &RetainExpansion, Optional< unsigned > &NumExpansions)
Determine whether we could expand a pack expansion with the given set of parameter packs into separat...
TypeSourceInfo * getTypeSourceInfo() const
SourceLocation getTemplateEllipsisLoc() const
No entity found met the criteria within the current instantiation,, but there were dependent base cla...
TypeSourceInfo * getNamedTypeInfo() const
getNamedTypeInfo - Returns the source type info associated to the name.
bool containsUnexpandedParameterPack() const
Whether this template argument contains an unexpanded parameter pack.
Represents the results of name lookup.
bool DiagnoseUnexpandedParameterPacks(SourceLocation Loc, UnexpandedParameterPackContext UPPC, ArrayRef< UnexpandedParameterPack > Unexpanded)
Diagnose unexpanded parameter packs.
unsigned getNumTypeObjects() const
Return the number of types applied to this declarator.
ParsedTemplateTy getAsTemplate() const
Retrieve the template template argument's template name.
KindType getKind() const
Determine what kind of template argument we have.
NestedNameSpecifierLoc getTemplateQualifierLoc() const
capture_iterator capture_end() const
Retrieve an iterator pointing past the end of the sequence of lambda captures.
ExprResult ActOnCXXFoldExpr(SourceLocation LParenLoc, Expr *LHS, tok::TokenKind Operator, SourceLocation EllipsisLoc, Expr *RHS, SourceLocation RParenLoc)
Handle a C++1z fold-expression: ( expr op ... op expr ).
Scope - A scope is a transient data structure that is used while parsing the program.
void DiagnoseAmbiguousLookup(LookupResult &Result)
Produce a diagnostic describing the ambiguity that resulted from name lookup.
Represents a C++ nested-name-specifier or a global scope specifier.
enum clang::DeclaratorChunk::@196 Kind
Optional< unsigned > getFullyPackExpandedSize(TemplateArgument Arg)
Given a template argument that contains an unexpanded parameter pack, but which has already been subs...
SourceLocation getTemplateNameLoc() const
Expr * Key
The key for the dictionary element.
A C++ lambda expression, which produces a function object (of unspecified type) that can be invoked l...
A class that does preordor or postorder depth-first traversal on the entire Clang AST and visits each...
ParsedTemplateArgument getTemplatePackExpansion(SourceLocation EllipsisLoc) const
Retrieve a pack expansion of the given template template argument.
detail::InMemoryDirectory::const_iterator I
T castAs() const
Convert to the specified TypeLoc type, asserting that this TypeLoc is of the desired type...
SourceRange getRange() const
TyLocType push(QualType T)
Pushes space for a new TypeLoc of the given type.
SourceLocation getLoc() const
getLoc - Returns the main location of the declaration name.
Optional< unsigned > getNumExpansions() const
Determine the number of expansions that will be produced when this pack expansion is instantiated...
Optional< unsigned > getNumTemplateExpansions() const
Retrieve the number of expansions that a template template argument expansion will produce...
Sema - This implements semantic analysis and AST building for C.
TemplateArgumentLoc getTemplateArgumentPackExpansionPattern(TemplateArgumentLoc OrigLoc, SourceLocation &Ellipsis, Optional< unsigned > &NumExpansions) const
Returns the pattern of the pack expansion for a template argument.
A little helper class used to produce diagnostics.
TST getTypeSpecType() const
const DeclarationNameInfo & getLookupNameInfo() const
Gets the name info to look up.
bool containsUnexpandedParameterPack() const
Determines whether this template name contains an unexpanded parameter pack (for C++0x variadic templ...
void MarkAnyDeclReferenced(SourceLocation Loc, Decl *D, bool MightBeOdrUse)
Perform marking for a reference to an arbitrary declaration.
SourceLocation getLocEnd() const LLVM_READONLY
unsigned NumParams
NumParams - This is the number of formal parameters specified by the declarator.
bool isPackExpansion() const
Determines whether this dictionary element is a pack expansion.
NameKind getNameKind() const
getNameKind - Determine what kind of name this is.
An expression "T()" which creates a value-initialized rvalue of type T, which is a non-class type...
TypeSourceInfo * CheckPackExpansion(TypeSourceInfo *Pattern, SourceLocation EllipsisLoc, Optional< unsigned > NumExpansions)
Construct a pack expansion type from the pattern of the pack expansion.
Expr - This represents one expression.
bool containsUnexpandedParameterPacks(Declarator &D)
Determine whether the given declarator contains any unexpanded parameter packs.
Declaration of a template type parameter.
The template argument is a null pointer or null pointer to member that was provided for a non-type te...
NamedDecl * getFoundDecl() const
Fetch the unique decl found by this lookup.
ArgKind getKind() const
Return the kind of stored template argument.
ObjCDictionaryLiteral - AST node to represent objective-c dictionary literals; as in:"name" : NSUserN...
SubstTemplateTemplateParmPackStorage * getAsSubstTemplateTemplateParmPack() const
Retrieve the substituted template template parameter pack, if known.
NonTypeTemplateParmDecl - Declares a non-type template parameter, e.g., "Size" in.
Represents a C++ template name within the type system.
char __ovld __cnfn min(char x, char y)
Returns y if y < x, otherwise it returns x.
Defines the clang::TypeLoc interface and its subclasses.
QualType getType() const
Get the type for which this source info wrapper provides information.
SmallVector< sema::FunctionScopeInfo *, 4 > FunctionScopes
Stack containing information about each of the nested function, block, and method scopes that are cur...
void setEllipsisLoc(SourceLocation Loc)
QualType getCXXNameType() const
getCXXNameType - If this name is one of the C++ names (of a constructor, destructor, or conversion function), return the type associated with that name.
Represents a folding of a pack over an operator.
Data structure that captures multiple levels of template argument lists for use in template instantia...
TemplateTemplateParmDecl - Declares a template template parameter, e.g., "T" in.
ExceptionSpecificationType getExceptionSpecType() const
Get the type of exception specification this function has.
bool hasTrailingReturnType() const
Determine whether this function declarator had a trailing-return-type.
The result type of a method or function.
ParsedTemplateArgument ActOnPackExpansion(const ParsedTemplateArgument &Arg, SourceLocation EllipsisLoc)
Invoked when parsing a template argument followed by an ellipsis, which creates a pack expansion...
static StringRef getIdentifier(const Token &Tok)
const TypeClass * getTypePtr() const
TypeAndRange * Exceptions
Pointer to a new[]'d array of TypeAndRange objects that contain the types in the function's dynamic e...
NestedNameSpecifier * getScopeRep() const
Retrieve the representation of the nested-name-specifier.
QualType getPackExpansionType(QualType Pattern, Optional< unsigned > NumExpansions)
TypeLoc getTypeLoc() const
Return the TypeLoc wrapper for the type source info.
NamedDecl * getPartiallySubstitutedPack(const TemplateArgument **ExplicitArgs=nullptr, unsigned *NumExplicitArgs=nullptr) const
Retrieve the partially-substitued template parameter pack.
ActionResult - This structure is used while parsing/acting on expressions, stmts, etc...
Represents the parsed form of a C++ template argument.
bool Subst(const TemplateArgumentLoc *Args, unsigned NumArgs, TemplateArgumentListInfo &Result, const MultiLevelTemplateArgumentList &TemplateArgs)
unsigned getNumLevels() const
Determine the number of levels in this template argument list.
Encodes a location in the source.
Expr * getAsExpr() const
Retrieve the non-type template argument's expression.
TemplateName getAsTemplate() const
Retrieve the template name for a template name argument.
Expr * getRepAsExpr() const
A structure for storing an already-substituted template template parameter pack.
static SizeOfPackExpr * Create(ASTContext &Context, SourceLocation OperatorLoc, NamedDecl *Pack, SourceLocation PackLoc, SourceLocation RParenLoc, Optional< unsigned > Length=None, ArrayRef< TemplateArgument > PartialArgs=None)
TypeSourceInfo * getTrivialTypeSourceInfo(QualType T, SourceLocation Loc=SourceLocation()) const
Allocate a TypeSourceInfo where all locations have been initialized to a given location, which defaults to the empty location.
ParsedType getRepAsType() const
SourceLocation getNameLoc() const
Name lookup found an unresolvable value declaration and cannot yet complete.
MemberPointerTypeInfo Mem
TokenKind
Provides a simple uniform namespace for tokens from all C languages.
SourceLocation getBegin() const
SourceLocation getBeginLoc() const
No entity found met the criteria.
A template type parameter, stored as a type.
QualType getType() const
Return the type wrapped by this type source info.
SourceLocation getExprLoc() const LLVM_READONLY
getExprLoc - Return the preferred location for the arrow when diagnosing a problem with a generic exp...
Expr * Value
The value of the dictionary element.
void diagnoseTypo(const TypoCorrection &Correction, const PartialDiagnostic &TypoDiag, bool ErrorRecovery=true)
SourceLocation getEllipsisLoc() const
Retrieve the location of the ellipsis that describes this pack expansion.
Represents a template argument.
QualType getAsType() const
Retrieve the type for a type template argument.
void collectUnexpandedParameterPacks(TemplateArgument Arg, SmallVectorImpl< UnexpandedParameterPack > &Unexpanded)
Collect the set of unexpanded parameter packs within the given template argument. ...
const CXXScopeSpec & getScopeSpec() const
Retrieve the nested-name-specifier that precedes the template name in a template template argument...
StringRef getOpcodeStr() const
Sema::LookupNameKind getLookupKind() const
Gets the kind of lookup to perform.
SourceLocation getEllipsisLoc() const
The template argument is a pack expansion of a template name that was provided for a template templat...
bool isParameterPack() const
Represents a C++11 pack expansion that produces a sequence of expressions.
bool isNull() const
Determine whether this template argument has no value.
detail::InMemoryDirectory::const_iterator E
static void CheckFoldOperand(Sema &S, Expr *E)
DeclarationNameInfo - A collector data type for bundling together a DeclarationName and the correspnd...
ExprResult BuildEmptyCXXFoldExpr(SourceLocation EllipsisLoc, BinaryOperatorKind Operator)
unsigned getDepth() const
Get the nesting depth of the template parameter.
SourceRange getSourceRange() const LLVM_READONLY
Get the full source range.
Name lookup found a single declaration that met the criteria.
NamedDecl * getCorrectionDecl() const
Gets the pointer to the declaration of the typo correction.
Location wrapper for a TemplateArgument.
unsigned getNumExceptions() const
Get the number of dynamic exception specifications.
ExprResult BuildCXXFoldExpr(SourceLocation LParenLoc, Expr *LHS, BinaryOperatorKind Operator, SourceLocation EllipsisLoc, Expr *RHS, SourceLocation RParenLoc)
const T * getAs() const
Member-template getAs<specific type>'.
ExprResult ActOnCXXBoolLiteral(SourceLocation OpLoc, tok::TokenKind Kind)
ActOnCXXBoolLiteral - Parse {true,false} literals.
bool isNull() const
Determine whether this template name is NULL.
bool isInvalid() const
Determine whether the given template argument is invalid.
The template argument is a type.
static FixItHint CreateInsertion(SourceLocation InsertionLoc, StringRef Code, bool BeforePreviousInsertions=false)
Create a code modification hint that inserts the given code string at a specific location.
const TypeClass * getTypePtr() const
The template argument is actually a parameter pack.
bool isUnexpandedParameterPackPermitted()
Determine whether an unexpanded parameter pack might be permitted in this location.
static QualType GetTypeFromParser(ParsedType Ty, TypeSourceInfo **TInfo=nullptr)
bool DiagnoseUnexpandedParameterPack(SourceLocation Loc, TypeSourceInfo *T, UnexpandedParameterPackContext UPPC)
If the given type contains an unexpanded parameter pack, diagnose the error.
Captures information about "declaration specifiers".
The template argument is a template name that was provided for a template template parameter...
Expr * NumElts
This is the size of the array, or null if [] or [*] was specified.
ExprResult CorrectDelayedTyposInExpr(Expr *E, VarDecl *InitDecl=nullptr, llvm::function_ref< ExprResult(Expr *)> Filter=[](Expr *E) -> ExprResult{return E;})
Process any TypoExprs in the given Expr and its children, generating diagnostics as appropriate and r...
LookupResultKind getResultKind() const
SourceRange getSourceRange() const LLVM_READONLY
SourceLocation tokens are not useful in isolation - they are low level value objects created/interpre...
Expr * getPattern()
Retrieve the pattern of the pack expansion.
bool isValid() const
A scope specifier is present, and it refers to a real scope.
A reference to a declared variable, function, enum, etc.
Optional< unsigned > getNumArgumentsInExpansion(QualType T, const MultiLevelTemplateArgumentList &TemplateArgs)
Determine the number of arguments in the given pack expansion type.
const DeclaratorChunk & getTypeObject(unsigned i) const
Return the specified TypeInfo from this declarator.
Wrapper for template type parameters.
bool isParameterPack() const
Whether this declaration is a parameter pack.
A trivial tuple used to represent a source range.
TypoCorrection CorrectTypo(const DeclarationNameInfo &Typo, Sema::LookupNameKind LookupKind, Scope *S, CXXScopeSpec *SS, std::unique_ptr< CorrectionCandidateCallback > CCC, CorrectTypoKind Mode, DeclContext *MemberContext=nullptr, bool EnteringContext=false, const ObjCObjectPointerType *OPT=nullptr, bool RecordFailure=true)
Try to "correct" a typo in the source code by finding visible declarations whose names are similar to...
NamedDecl - This represents a decl with a name.
A template template argument, stored as a template name.
bool isNull() const
Return true if this QualType doesn't point to a type yet.
void pushFullCopy(TypeLoc L)
Pushes a copy of the given TypeLoc onto this builder.
ExprResult ActOnSizeofParameterPackExpr(Scope *S, SourceLocation OpLoc, IdentifierInfo &Name, SourceLocation NameLoc, SourceLocation RParenLoc)
Called when an expression computing the size of a parameter pack is parsed.
SourceLocation getLocStart() const LLVM_READONLY
const TemplateArgument & getArgument() const
Optional< unsigned > getNumExpansions() const
Retrieve the number of expansions that this pack expansion will generate, if known.
unsigned getNumElements() const
getNumElements - Return number of elements of objective-c dictionary literal.
ParamInfo * Params
Params - This is a pointer to a new[]'d array of ParamInfo objects that describe the parameters speci...
unsigned getIndex() const
Get the index of the template parameter within its parameter list.
const DeclSpec & getDeclSpec() const
getDeclSpec - Return the declaration-specifier that this declarator was declared with.