22 using namespace clang;
30 class CollectUnexpandedParameterPacksVisitor :
38 bool InLambda =
false;
39 unsigned DepthLimit = (unsigned)-1;
42 if (
auto *VD = dyn_cast<VarDecl>(ND)) {
48 if (FTD && FTD->getTemplateParameters()->getDepth() >= DepthLimit)
53 Unexpanded.push_back({ND, Loc});
58 Unexpanded.push_back({T, Loc});
62 explicit CollectUnexpandedParameterPacksVisitor(
64 : Unexpanded(Unexpanded) {}
66 bool shouldWalkTypesOfTypeLocs()
const {
return false; }
102 if (
auto *TTP = dyn_cast_or_null<TemplateTemplateParmDecl>(
104 if (TTP->isParameterPack())
108 return inherited::TraverseTemplateName(Template);
122 TraverseStmt(Element.
Key);
123 TraverseStmt(Element.
Value);
133 bool TraverseStmt(
Stmt *S) {
134 Expr *E = dyn_cast_or_null<Expr>(S);
136 return inherited::TraverseStmt(S);
145 return inherited::TraverseType(T);
152 bool TraverseTypeLoc(
TypeLoc TL) {
156 return inherited::TraverseTypeLoc(TL);
162 bool TraverseDecl(
Decl *D) {
169 return inherited::TraverseDecl(D);
173 bool TraverseAttr(
Attr *A) {
177 return inherited::TraverseAttr(A);
185 bool TraverseCXXFoldExpr(
CXXFoldExpr *E) {
return true; }
194 return inherited::TraverseUnresolvedUsingValueDecl(D);
202 return inherited::TraverseUnresolvedUsingTypenameDecl(D);
210 return inherited::TraverseTemplateArgument(Arg);
218 return inherited::TraverseTemplateArgumentLoc(ArgLoc);
226 return inherited::TraverseCXXBaseSpecifier(Base);
234 return inherited::TraverseConstructorInitializer(Init);
248 bool WasInLambda = InLambda;
249 unsigned OldDepthLimit = DepthLimit;
253 DepthLimit = TPL->getDepth();
255 inherited::TraverseLambdaExpr(Lambda);
257 InLambda = WasInLambda;
258 DepthLimit = OldDepthLimit;
268 return inherited::TraverseLambdaCapture(Lambda, C, Init);
281 for (
auto *SI : FunctionScopes)
282 if (isa<sema::LambdaScopeInfo>(SI))
293 if (Unexpanded.empty())
302 for (
unsigned N = FunctionScopes.size(); N; --N) {
314 if (
auto *LSI = dyn_cast<sema::LambdaScopeInfo>(Func)) {
315 if (N == FunctionScopes.size()) {
316 for (
auto &Pack : Unexpanded) {
317 auto *VD = dyn_cast_or_null<VarDecl>(
319 if (VD && VD->getDeclContext() == LSI->CallOperator)
320 LambdaParamPackReferences.push_back(Pack);
328 if (!LambdaParamPackReferences.empty()) {
329 Unexpanded = LambdaParamPackReferences;
333 LSI->ContainsUnexpandedParameterPack =
true;
340 llvm::SmallPtrSet<IdentifierInfo *, 4> NamesKnown;
342 for (
unsigned I = 0, N = Unexpanded.size(); I != N; ++I) {
346 Name = TTP->getIdentifier();
350 if (Name && NamesKnown.insert(Name).second)
351 Names.push_back(Name);
353 if (Unexpanded[I].second.isValid())
354 Locations.push_back(Unexpanded[I].second);
358 << (int)UPPC << (
int)Names.size();
359 for (
size_t I = 0, E =
std::min(Names.size(), (
size_t)2); I != E; ++I)
362 for (
unsigned I = 0, N = Locations.size(); I != N; ++I)
377 CollectUnexpandedParameterPacksVisitor(Unexpanded).TraverseTypeLoc(
379 assert(!Unexpanded.empty() &&
"Unable to find unexpanded parameter packs");
392 CollectUnexpandedParameterPacksVisitor(Unexpanded).TraverseStmt(E);
393 assert(!Unexpanded.empty() &&
"Unable to find unexpanded parameter packs");
407 CollectUnexpandedParameterPacksVisitor(Unexpanded)
409 assert(!Unexpanded.empty() &&
"Unable to find unexpanded parameter packs");
435 return DiagnoseUnexpandedParameterPack(NameInfo.
getLoc(), TSInfo, UPPC);
444 CollectUnexpandedParameterPacksVisitor(Unexpanded)
446 assert(!Unexpanded.empty() &&
"Unable to find unexpanded parameter packs");
458 CollectUnexpandedParameterPacksVisitor(Unexpanded)
459 .TraverseTemplateName(Template);
460 assert(!Unexpanded.empty() &&
"Unable to find unexpanded parameter packs");
471 CollectUnexpandedParameterPacksVisitor(Unexpanded)
472 .TraverseTemplateArgumentLoc(Arg);
473 assert(!Unexpanded.empty() &&
"Unable to find unexpanded parameter packs");
479 CollectUnexpandedParameterPacksVisitor(Unexpanded)
480 .TraverseTemplateArgument(Arg);
485 CollectUnexpandedParameterPacksVisitor(Unexpanded)
486 .TraverseTemplateArgumentLoc(Arg);
491 CollectUnexpandedParameterPacksVisitor(Unexpanded).TraverseType(T);
496 CollectUnexpandedParameterPacksVisitor(Unexpanded).TraverseTypeLoc(TL);
502 CollectUnexpandedParameterPacksVisitor(Unexpanded)
503 .TraverseNestedNameSpecifierLoc(NNS);
509 CollectUnexpandedParameterPacksVisitor(Unexpanded)
510 .TraverseDeclarationNameInfo(NameInfo);
544 Diag(EllipsisLoc, diag::err_pack_expansion_without_parameter_packs)
551 llvm_unreachable(
"Unhandled template argument kind?");
557 GetTypeFromParser(Type, &TSInfo);
565 return CreateParsedType(TSResult->
getType(), TSResult);
574 EllipsisLoc, NumExpansions);
598 Diag(EllipsisLoc, diag::err_pack_expansion_without_parameter_packs)
607 return CheckPackExpansion(Pattern, EllipsisLoc,
None);
620 Diag(EllipsisLoc, diag::err_pack_expansion_without_parameter_packs)
622 CorrectDelayedTyposInExpr(Pattern);
637 RetainExpansion =
false;
638 std::pair<IdentifierInfo *, SourceLocation> FirstPack;
639 bool HaveFirstPack =
false;
644 end = Unexpanded.end();
647 unsigned Depth = 0, Index = 0;
649 bool IsVarDeclPack =
false;
653 Depth = TTP->getDepth();
654 Index = TTP->getIndex();
655 Name = TTP->getIdentifier();
658 if (isa<VarDecl>(ND))
659 IsVarDeclPack =
true;
667 unsigned NewPackSize;
672 llvm::PointerUnion<Decl *, DeclArgumentPack *> *Instantiation
673 = CurrentInstantiationScope->findInstantiationOf(
675 if (Instantiation->is<DeclArgumentPack *>()) {
677 NewPackSize = Instantiation->get<DeclArgumentPack *>()->size();
681 ShouldExpand =
false;
690 ShouldExpand =
false;
695 NewPackSize = TemplateArgs(Depth, Index).pack_size();
702 if (!IsVarDeclPack && CurrentInstantiationScope) {
704 = CurrentInstantiationScope->getPartiallySubstitutedPack()){
705 unsigned PartialDepth, PartialIndex;
707 if (PartialDepth == Depth && PartialIndex == Index) {
708 RetainExpansion =
true;
710 NumPartialExpansions = NewPackSize;
711 PartiallySubstitutedPackLoc =
i->second;
717 if (!NumExpansions) {
720 NumExpansions = NewPackSize;
721 FirstPack.first = Name;
722 FirstPack.second =
i->second;
723 HaveFirstPack =
true;
727 if (NewPackSize != *NumExpansions) {
732 Diag(EllipsisLoc, diag::err_pack_expansion_length_conflict)
733 << FirstPack.first << Name << *NumExpansions << NewPackSize
736 Diag(EllipsisLoc, diag::err_pack_expansion_length_conflict_multilevel)
737 << Name << *NumExpansions << NewPackSize
738 << SourceRange(
i->second);
752 if (NumPartialExpansions) {
753 if (NumExpansions && *NumExpansions < *NumPartialExpansions) {
755 CurrentInstantiationScope->getPartiallySubstitutedPack();
756 Diag(EllipsisLoc, diag::err_pack_expansion_length_conflict_partial)
757 << PartialPack << *NumPartialExpansions << *NumExpansions
762 NumExpansions = NumPartialExpansions;
770 QualType Pattern = cast<PackExpansionType>(T)->getPattern();
772 CollectUnexpandedParameterPacksVisitor(Unexpanded).TraverseType(Pattern);
775 for (
unsigned I = 0, N = Unexpanded.size(); I != N; ++I) {
782 Depth = TTP->getDepth();
783 Index = TTP->getIndex();
786 if (isa<VarDecl>(ND)) {
790 llvm::PointerUnion<Decl *, DeclArgumentPack *> *Instantiation
791 = CurrentInstantiationScope->findInstantiationOf(
793 if (Instantiation->is<
Decl*>())
798 unsigned Size = Instantiation->get<DeclArgumentPack *>()->size();
799 assert((!Result || *Result == Size) &&
"inconsistent pack sizes");
813 unsigned Size = TemplateArgs(Depth, Index).pack_size();
814 assert((!Result || *Result == Size) &&
"inconsistent pack sizes");
869 #define GENERIC_IMAGE_TYPE(ImgType, Id) case TST_##ImgType##_t: 870 #include "clang/Basic/OpenCLImageTypes.def" 878 switch (Chunk.
Kind) {
896 assert(!ParamTy.isNull() &&
"Couldn't parse type?");
897 if (ParamTy->containsUnexpandedParameterPack())
return true;
934 bool ValidateCandidate(
const TypoCorrection &candidate)
override {
939 std::unique_ptr<CorrectionCandidateCallback> clone()
override {
940 return llvm::make_unique<ParameterPackValidatorCCC>(*this);
967 LookupResult R(*
this, &Name, NameLoc, LookupOrdinaryName);
978 ParameterPackValidatorCCC CCC{};
981 CCC, CTK_ErrorRecovery)) {
982 diagnoseTypo(Corrected,
983 PDiag(diag::err_sizeof_pack_no_pack_name_suggest) << &Name,
984 PDiag(diag::note_parameter_pack_here));
985 ParameterPack = Corrected.getCorrectionDecl();
994 DiagnoseAmbiguousLookup(R);
999 Diag(NameLoc, diag::err_sizeof_pack_no_pack_name)
1004 MarkAnyDeclReferenced(OpLoc, ParameterPack,
true);
1021 if (!ExpansionTSInfo)
1044 = cast<PackExpansionExpr>(Argument.
getAsExpr());
1067 llvm_unreachable(
"Invalid TemplateArgument Kind!");
1082 Pack = Subst->getArgumentPack();
1089 dyn_cast<SubstNonTypeTemplateParmPackExpr>(Arg.
getAsExpr()))
1090 Pack = Subst->getArgumentPack();
1091 else if (
auto *Subst = dyn_cast<FunctionParmPackExpr>(Arg.
getAsExpr())) {
1093 if (PD->isParameterPack())
1095 return Subst->getNumExpansions();
1103 Pack = Subst->getArgumentPack();
1121 if (Elem.isPackExpansion())
1124 return Pack.pack_size();
1133 if ((OCE && OCE->isInfixBinaryOp()) || isa<BinaryOperator>(E) ||
1134 isa<AbstractConditionalOperator>(E)) {
1151 auto DiscardOperands = [&] {
1152 CorrectDelayedTyposInExpr(LHS);
1153 CorrectDelayedTyposInExpr(RHS);
1164 return Diag(EllipsisLoc,
1166 ? diag::err_fold_expression_packs_both_sides
1167 : diag::err_pack_expansion_without_parameter_packs)
1175 Expr *Pack = LHS ? LHS : RHS;
1176 assert(Pack &&
"fold expression with neither LHS nor RHS");
1179 return Diag(EllipsisLoc, diag::err_pack_expansion_without_parameter_packs)
1184 return BuildCXXFoldExpr(LParenLoc, LHS, Opc, EllipsisLoc, RHS, RParenLoc,
1194 Operator, EllipsisLoc, RHS, RParenLoc,
1212 return ActOnCXXBoolLiteral(EllipsisLoc, tok::kw_false);
1214 return ActOnCXXBoolLiteral(EllipsisLoc, tok::kw_true);
1216 ScalarType = Context.
VoidTy;
1220 return Diag(EllipsisLoc, diag::err_fold_expression_empty)
ParsedType getTrailingReturnType() const
Get the trailing-return-type for this function declarator.
A call to an overloaded operator written using operator syntax.
SourceLocation getLoc() const
getLoc - Returns the main location of the declaration name.
Represents a function declaration or definition.
Name lookup found a set of overloaded functions that met the criteria.
UnexpandedParameterPackContext
The context in which an unexpanded parameter pack is being diagnosed.
static DiagnosticBuilder Diag(DiagnosticsEngine *Diags, const LangOptions &Features, FullSourceLoc TokLoc, const char *TokBegin, const char *TokRangeBegin, const char *TokRangeEnd, unsigned DiagID)
Produce a diagnostic highlighting some portion of a literal.
ObjCDictionaryElement getKeyValueElement(unsigned Index) const
const TypeClass * getTypePtr() const
A (possibly-)qualified type.
Simple class containing the result of Sema::CorrectTypo.
const TypeClass * getTypePtr() const
const DeclaratorChunk & getTypeObject(unsigned i) const
Return the specified TypeInfo from this declarator.
NestedNameSpecifierLoc getTemplateQualifierLoc() const
Stmt - This represents one statement.
The template argument is an expression, and we've not resolved it to one of the other forms yet...
SemaDiagnosticBuilder Diag(SourceLocation Loc, unsigned DiagID)
Emit a diagnostic.
Decl - This represents one declaration (or definition), e.g.
Expr * getAsExpr() const
Retrieve the non-type template argument's expression.
bool isPackExpansion() const
Determine whether this is a pack expansion.
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.
bool isPackExpansion() const
Determine whether this capture is a pack expansion, which captures a function parameter pack...
Describes the capture of a variable or of this, or of a C++1y init-capture.
bool isPackExpansion() const
Determine whether this initializer is a pack expansion.
Retains information about a function, method, or block that is currently being parsed.
Represents a variable declaration or definition.
Information about one declarator, including the parsed type information and the identifier.
const T * getAs() const
Member-template getAs<specific type>'.
Represents an empty template argument, e.g., one that has not been deduced.
void setBegin(SourceLocation b)
bool isParameterPack() const
Whether this declaration is a parameter pack.
unsigned getNumExceptions() const
Get the number of dynamic exception specifications.
Represents a parameter to a function.
enum clang::DeclaratorChunk::@217 Kind
IdentifierInfo * getIdentifier() const
Get the identifier that names this declaration, if there is one.
Base wrapper for a particular "section" of type source info.
Expr * NoexceptExpr
Pointer to the expression in the noexcept-specifier of this function, if it has one.
ExprResult BuildCXXFoldExpr(SourceLocation LParenLoc, Expr *LHS, BinaryOperatorKind Operator, SourceLocation EllipsisLoc, Expr *RHS, SourceLocation RParenLoc, Optional< unsigned > NumExpansions)
One of these records is kept for each identifier that is lexed.
Name lookup results in an ambiguity; use getAmbiguityKind to figure out what kind of ambiguity we hav...
TemplateArgument getPackExpansionPattern() const
When the template argument is a pack expansion, returns the pattern of the pack expansion.
An element in an Objective-C dictionary literal.
Expr * getAsExpr() const
Retrieve the template argument as an expression.
A C++ nested-name-specifier augmented with source location information.
TypeSourceInfo * getTypeSourceInfo() const
The template argument is an integral value stored in an llvm::APSInt that was provided for an integra...
TemplateDecl * getAsTemplateDecl() const
Retrieve the underlying template declaration that this template name refers to, if known...
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 getBeginLoc() const LLVM_READONLY
NameKind getNameKind() const
Determine what kind of name this is.
SubstTemplateTemplateParmPackStorage * getAsSubstTemplateTemplateParmPack() const
Retrieve the substituted template template parameter pack, if known.
SourceLocation getLocation() const
Retrieve the location of the template argument.
SourceLocation getLocation() const
const DeclarationNameInfo & getLookupNameInfo() const
Gets the name info to look up.
Optional< unsigned > getNumTemplateExpansions() const
Retrieve the number of expansions that a template template argument expansion will produce...
Represents the result of substituting a set of types for a template type parameter pack...
__SIZE_TYPE__ size_t
The unsigned integer type of the result of the sizeof operator.
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...
LookupResultKind getResultKind() const
ParsedType getAsType() const
Retrieve the template type argument's type.
No entity found met the criteria within the current instantiation,, but there were dependent base cla...
StringRef getOpcodeStr() const
Represents the results of name lookup.
bool DiagnoseUnexpandedParameterPacks(SourceLocation Loc, UnexpandedParameterPackContext UPPC, ArrayRef< UnexpandedParameterPack > Unexpanded)
Diagnose unexpanded parameter packs.
FunctionTemplateDecl * getDescribedFunctionTemplate() const
Retrieves the function template that is described by this function declaration.
unsigned getNumTypeObjects() const
Return the number of types applied to this declarator.
bool containsUnexpandedParameterPack() const
Whether this type is or contains an unexpanded parameter pack, used to support C++0x variadic templat...
SourceLocation getTemplateEllipsisLoc() const
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.
Represents a C++ nested-name-specifier or a global scope specifier.
Optional< unsigned > getFullyPackExpandedSize(TemplateArgument Arg)
Given a template argument that contains an unexpanded parameter pack, but which has already been subs...
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 preorder or postorder depth-first traversal on the entire Clang AST and visits each...
Expr * IgnoreImpCasts() LLVM_READONLY
Skip past any implicit casts which might surround this expression until reaching a fixed point...
Contains information about the compound statement currently being parsed.
TyLocType push(QualType T)
Pushes space for a new TypeLoc of the given type.
Sema - This implements semantic analysis and AST building for C.
bool containsUnexpandedParameterPack() const
Determines whether this template name contains an unexpanded parameter pack (for C++0x variadic templ...
A little helper class used to produce diagnostics.
std::pair< unsigned, unsigned > getDepthAndIndex(NamedDecl *ND)
Retrieve the depth and index of a template parameter.
unsigned NumParams
NumParams - This is the number of formal parameters specified by the declarator.
SourceLocation getLocation() const
SourceRange getRange() const
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.
TST getTypeSpecType() const
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.
QualType getCXXNameType() const
If this name is one of the C++ names (of a constructor, destructor, or conversion function)...
This represents one expression.
bool containsUnexpandedParameterPacks(Declarator &D)
Determine whether the given declarator contains any unexpanded parameter packs.
bool isPackExpansion() const
The template argument is a null pointer or null pointer to member that was provided for a non-type te...
bool isPackExpansion() const
Determine whether this is a pack expansion.
ObjCDictionaryLiteral - AST node to represent objective-c dictionary literals; as in:"name" : NSUserN...
SourceLocation getBeginLoc() const
SourceLocation getEllipsisLoc() const
TypeSourceInfo * getNamedTypeInfo() const
getNamedTypeInfo - Returns the source type info associated to the name.
Represents a C++ template name within the type system.
Defines the clang::TypeLoc interface and its subclasses.
void setEllipsisLoc(SourceLocation Loc)
Represents a folding of a pack over an operator.
Data structure that captures multiple levels of template argument lists for use in template instantia...
bool isPackExpansion() const
Determine whether this template argument is a pack expansion.
The result type of a method or function.
bool isNull() const
Return true if this QualType doesn't point to a type yet.
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)
SourceLocation getEndLoc() const LLVM_READONLY
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)
const CXXScopeSpec & getScopeSpec() const
Retrieve the nested-name-specifier that precedes the template name in a template template argument...
bool isComputedNoexcept(ExceptionSpecificationType ESpecType)
static bool DiagnoseUnexpandedParameterPacks(Sema &S, TemplateTemplateParmDecl *TTP)
Check for unexpanded parameter packs within the template parameters of a template template parameter...
bool containsUnexpandedParameterPack() const
Whether this nested-name-specifier contains an unexpanded parameter pack (for C++11 variadic template...
TypeLoc getPatternLoc() const
ActionResult - This structure is used while parsing/acting on expressions, stmts, etc...
Represents the parsed form of a C++ template argument.
Encodes a location in the source.
A structure for storing an already-substituted template template parameter pack.
unsigned getNumElements() const
getNumElements - Return number of elements of objective-c dictionary literal.
DeclarationName getName() const
getName - Returns the embedded declaration name.
SourceLocation getEllipsisLoc() const
Retrieve the location of the ellipsis that describes this pack expansion.
static SizeOfPackExpr * Create(ASTContext &Context, SourceLocation OperatorLoc, NamedDecl *Pack, SourceLocation PackLoc, SourceLocation RParenLoc, Optional< unsigned > Length=None, ArrayRef< TemplateArgument > PartialArgs=None)
Represents a dependent using declaration which was not marked with typename.
KindType getKind() const
Determine what kind of template argument we have.
bool isPackExpansion() const
Determine whether this base specifier is a pack expansion.
bool isParameterPack() 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.
bool hasTrailingReturnType() const
Determine whether this function declarator had a trailing-return-type.
No entity found met the criteria.
A template type parameter, stored as a type.
bool hasTemplateArgument(unsigned Depth, unsigned Index) const
Determine whether there is a non-NULL template argument at the given depth and index.
Optional< unsigned > getNumExpansions() const
Retrieve the number of expansions that this pack expansion will generate, if known.
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.
Represents a pack expansion of types.
ArrayRef< TemplateArgument > pack_elements() const
Iterator range referencing all of the elements of a template argument pack.
Represents a template argument.
void collectUnexpandedParameterPacks(TemplateArgument Arg, SmallVectorImpl< UnexpandedParameterPack > &Unexpanded)
Collect the set of unexpanded parameter packs within the given template argument. ...
bool isNull() const
Determine whether this template name is NULL.
Dataflow Directional Tag Classes.
bool containsUnexpandedParameterPack() const
Whether this template argument contains an unexpanded parameter pack.
ParsedTemplateTy getAsTemplate() const
Retrieve the template template argument's template name.
DeducedType * getContainedDeducedType() const
Get the DeducedType whose type will be deduced for a variable with an initializer of this type...
const TemplateArgument & getArgument() const
QualType getType() const
Get the type for which this source info wrapper provides information.
The template argument is a pack expansion of a template name that was provided for a template templat...
bool isInvalid() const
Determine whether the given template argument is invalid.
Represents a dependent using declaration which was marked with typename.
NamedDecl * getCorrectionDecl() const
Gets the pointer to the declaration of the typo correction.
NamedDecl * getFoundDecl() const
Fetch the unique decl found by this lookup.
Represents a C++11 pack expansion that produces a sequence of expressions.
static void CheckFoldOperand(Sema &S, Expr *E)
DeclarationNameInfo - A collector data type for bundling together a DeclarationName and the correspnd...
TemplateParameterList * getTemplateParameterList() const
If this is a generic lambda expression, retrieve the template parameter list associated with it...
ExprResult BuildEmptyCXXFoldExpr(SourceLocation EllipsisLoc, BinaryOperatorKind Operator)
bool isNull() const
Determine whether this template argument has no value.
bool isValid() const
A scope specifier is present, and it refers to a real scope.
SourceRange getSourceRange() const LLVM_READONLY
Get the full source range.
Name lookup found a single declaration that met the criteria.
Location wrapper for a TemplateArgument.
ParsedTemplateArgument getTemplatePackExpansion(SourceLocation EllipsisLoc) const
Retrieve a pack expansion of the given template template argument.
Represents a C++ base or member initializer.
unsigned getNumLevels() const
Determine the number of levels in this template argument list.
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.
ExceptionSpecificationType getExceptionSpecType() const
Get the type of exception specification this function has.
Sema::LookupNameKind getLookupKind() const
Gets the kind of lookup to perform.
The template argument is actually a parameter pack.
Represents a base class of a C++ class.
bool isUnexpandedParameterPackPermitted()
Determine whether an unexpanded parameter pack might be permitted in this location.
TypeLoc getTypeLoc() const
Return the TypeLoc wrapper for the type source info.
ArgKind getKind() const
Return the kind of stored template argument.
unsigned getDepth() const
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.
bool isPackExpansion() const
Determines whether this dictionary element is a pack expansion.
const DeclSpec & getDeclSpec() const
getDeclSpec - Return the declaration-specifier that this declarator was declared with.
bool containsUnexpandedParameterPack() const
Whether this expression contains an unexpanded parameter pack (for C++11 variadic templates)...
Optional< unsigned > getNumExpansions() const
Determine the number of expansions that will be produced when this pack expansion is instantiated...
SourceRange getSourceRange() const LLVM_READONLY
SourceLocation tokens are not useful in isolation - they are low level value objects created/interpre...
ParsedType getRepAsType() const
__DEVICE__ int min(int __a, int __b)
SourceLocation getNameLoc() const
Expr * getPattern()
Retrieve the pattern of the pack expansion.
QualType getAsType() const
Retrieve the type for a type template argument.
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.
SourceLocation getTemplateNameLoc() const
SmallVector< CompoundScopeInfo, 4 > CompoundScopes
The stack of currently active compound stamement scopes in the function.
TemplateArgumentLoc getTemplateArgumentPackExpansionPattern(TemplateArgumentLoc OrigLoc, SourceLocation &Ellipsis, Optional< unsigned > &NumExpansions) const
Returns the pattern of the pack expansion for a template argument.
Wrapper for template type parameters.
A trivial tuple used to represent a source range.
This represents a decl that may have a name.
Expr * getRepAsExpr() const
T castAs() const
Convert to the specified TypeLoc type, asserting that this TypeLoc is of the desired type...
A template template argument, stored as a template name.
TemplateName getAsTemplate() const
Retrieve the template name for a template name argument.
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 getBegin() const
ParamInfo * Params
Params - This is a pointer to a new[]'d array of ParamInfo objects that describe the parameters speci...
Attr - This represents one attribute.
QualType getType() const
Return the type wrapped by this type source info.