23 using namespace clang;
31 class CollectUnexpandedParameterPacksVisitor :
42 explicit CollectUnexpandedParameterPacksVisitor(
44 : Unexpanded(Unexpanded), InLambda(
false) { }
46 bool shouldWalkTypesOfTypeLocs()
const {
return false; }
74 if (E->
getDecl()->isParameterPack())
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()) {
187 if (VD->isParameterPack())
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");
340 CollectUnexpandedParameterPacksVisitor(Unexpanded)
342 assert(!Unexpanded.empty() &&
"Unable to find unexpanded parameter packs");
354 CollectUnexpandedParameterPacksVisitor(Unexpanded)
355 .TraverseTemplateName(Template);
356 assert(!Unexpanded.empty() &&
"Unable to find unexpanded parameter packs");
367 CollectUnexpandedParameterPacksVisitor(Unexpanded)
368 .TraverseTemplateArgumentLoc(Arg);
369 assert(!Unexpanded.empty() &&
"Unable to find unexpanded parameter packs");
375 CollectUnexpandedParameterPacksVisitor(Unexpanded)
376 .TraverseTemplateArgument(Arg);
381 CollectUnexpandedParameterPacksVisitor(Unexpanded)
382 .TraverseTemplateArgumentLoc(Arg);
387 CollectUnexpandedParameterPacksVisitor(Unexpanded).TraverseType(T);
392 CollectUnexpandedParameterPacksVisitor(Unexpanded).TraverseTypeLoc(TL);
402 CollectUnexpandedParameterPacksVisitor(Unexpanded)
403 .TraverseNestedNameSpecifierLoc(QualifierLoc);
408 CollectUnexpandedParameterPacksVisitor(Unexpanded)
409 .TraverseDeclarationNameInfo(NameInfo);
443 Diag(EllipsisLoc, diag::err_pack_expansion_without_parameter_packs)
450 llvm_unreachable(
"Unhandled template argument kind?");
473 EllipsisLoc, NumExpansions);
493 Diag(EllipsisLoc, diag::err_pack_expansion_without_parameter_packs)
515 Diag(EllipsisLoc, diag::err_pack_expansion_without_parameter_packs)
516 << Pattern->getSourceRange();
526 static std::pair<unsigned, unsigned>
529 return std::make_pair(TTP->getDepth(), TTP->getIndex());
532 return std::make_pair(NTTP->getDepth(), NTTP->getIndex());
544 RetainExpansion =
false;
545 std::pair<IdentifierInfo *, SourceLocation> FirstPack;
546 bool HaveFirstPack =
false;
549 end = Unexpanded.end();
552 unsigned Depth = 0, Index = 0;
554 bool IsFunctionParameterPack =
false;
558 Depth = TTP->getDepth();
559 Index = TTP->getIndex();
560 Name = TTP->getIdentifier();
563 if (isa<ParmVarDecl>(ND))
564 IsFunctionParameterPack =
true;
572 unsigned NewPackSize;
573 if (IsFunctionParameterPack) {
577 llvm::PointerUnion<Decl *, DeclArgumentPack *> *Instantiation
580 if (Instantiation->is<DeclArgumentPack *>()) {
582 NewPackSize = Instantiation->get<DeclArgumentPack *>()->size();
586 ShouldExpand =
false;
595 ShouldExpand =
false;
600 NewPackSize = TemplateArgs(Depth, Index).pack_size();
610 unsigned PartialDepth, PartialIndex;
612 if (PartialDepth == Depth && PartialIndex == Index)
613 RetainExpansion =
true;
617 if (!NumExpansions) {
620 NumExpansions = NewPackSize;
621 FirstPack.first =
Name;
622 FirstPack.second = i->second;
623 HaveFirstPack =
true;
627 if (NewPackSize != *NumExpansions) {
632 Diag(EllipsisLoc, diag::err_pack_expansion_length_conflict)
633 << FirstPack.first << Name << *NumExpansions << NewPackSize
636 Diag(EllipsisLoc, diag::err_pack_expansion_length_conflict_multilevel)
637 << Name << *NumExpansions << NewPackSize
638 << SourceRange(i->second);
648 QualType Pattern = cast<PackExpansionType>(T)->getPattern();
650 CollectUnexpandedParameterPacksVisitor(Unexpanded).TraverseType(Pattern);
653 for (
unsigned I = 0, N = Unexpanded.size();
I != N; ++
I) {
660 Depth = TTP->getDepth();
661 Index = TTP->getIndex();
664 if (isa<ParmVarDecl>(ND)) {
668 llvm::PointerUnion<Decl *, DeclArgumentPack *> *Instantiation
671 if (Instantiation->is<
Decl*>())
676 unsigned Size = Instantiation->get<DeclArgumentPack *>()->size();
677 assert((!Result || *Result == Size) &&
"inconsistent pack sizes");
691 unsigned Size = TemplateArgs(Depth, Index).pack_size();
692 assert((!Result || *Result == Size) &&
"inconsistent pack sizes");
743 #define GENERIC_IMAGE_TYPE(ImgType, Id) case TST_##ImgType##_t:
744 #include "clang/Basic/OpenCLImageTypes.def"
752 switch (Chunk.
Kind) {
767 for (
unsigned i = 0, e = Chunk.
Fun.
NumParams; i != e; ++i) {
770 assert(!ParamTy.isNull() &&
"Couldn't parse type?");
771 if (ParamTy->containsUnexpandedParameterPack())
return true;
808 bool ValidateCandidate(
const TypoCorrection &candidate)
override {
810 return ND && ND->isParameterPack();
850 llvm::make_unique<ParameterPackValidatorCCC>(),
853 PDiag(diag::err_sizeof_pack_no_pack_name_suggest) << &Name,
854 PDiag(diag::note_parameter_pack_here));
855 ParameterPack = Corrected.getCorrectionDecl();
867 if (!ParameterPack || !ParameterPack->isParameterPack()) {
868 Diag(NameLoc, diag::err_sizeof_pack_no_pack_name)
890 if (!ExpansionTSInfo)
913 = cast<PackExpansionExpr>(Argument.
getAsExpr());
936 llvm_unreachable(
"Invalid TemplateArgument Kind!");
944 if (isa<BinaryOperator>(E) || isa<AbstractConditionalOperator>(E)) {
946 << E->getSourceRange()
968 return Diag(EllipsisLoc,
970 ? diag::err_fold_expression_packs_both_sides
971 : diag::err_pack_expansion_without_parameter_packs)
972 << LHS->getSourceRange() << RHS->getSourceRange();
979 Expr *Pack = LHS ? LHS : RHS;
980 assert(Pack &&
"fold expression with neither LHS nor RHS");
982 return Diag(EllipsisLoc, diag::err_pack_expansion_without_parameter_packs)
983 << Pack->getSourceRange();
995 Operator, EllipsisLoc, RHS, RParenLoc);
1020 return Diag(EllipsisLoc, diag::err_fold_expression_empty)
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.
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...
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.
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.
class LLVM_ALIGNAS(8) DependentTemplateSpecializationType const IdentifierInfo * Name
Represents a template specialization type whose template cannot be resolved, e.g. ...
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.
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
char * location_data() const
Retrieve the data associated with the source-location information.
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.
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.
unsigned NumParams
NumParams - This is the number of formal parameters specified by the declarator.
unsigned NumExceptions
NumExceptions - This is the number of types in the dynamic-exception- decl, if the function has one...
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...
NonTypeTemplateParmDecl - Declares a non-type template parameter, e.g., "Size" in.
Represents a C++ template name within the type system.
enum clang::DeclaratorChunk::@185 Kind
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...
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.
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.
Expr * getRepAsExpr() const
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
Represents a C++ nested name specifier, such as "\::std::vector<int>::".
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.
const IdentifierInfo * getIdentifier() const
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.
ExprResult BuildCXXFoldExpr(SourceLocation LParenLoc, Expr *LHS, BinaryOperatorKind Operator, SourceLocation EllipsisLoc, Expr *RHS, SourceLocation RParenLoc)
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.
LookupResultKind getResultKind() const
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.
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.
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.