21 #include "llvm/Support/raw_ostream.h"
22 using namespace clang;
37 ID.AddPointer(parameter);
50 ID.AddPointer(Parameter);
58 return DependentTemplate;
60 return QualifiedTemplate;
65 return OverloadedTemplate;
67 return SubstTemplateTemplateParm;
68 return SubstTemplateTemplateParmPack;
76 return QTN->getTemplateDecl();
79 return sub->getReplacement().getAsTemplateDecl();
86 if (isa<TemplateTemplateParmDecl>(Template))
92 return Template->getDeclContext() &&
93 Template->getDeclContext()->isDependentContext();
96 assert(!getAsOverloadedTemplate() &&
97 "overloaded templates shouldn't survive to here");
104 if (QTN->getQualifier()->isInstantiationDependent())
108 return isDependent();
114 = dyn_cast<TemplateTemplateParmDecl>(Template))
115 return TTP->isParameterPack();
121 return DTN->getQualifier() &&
122 DTN->getQualifier()->containsUnexpandedParameterPack();
124 return getAsSubstTemplateTemplateParmPack() !=
nullptr;
129 bool SuppressNNS)
const {
134 QTN->getQualifier()->print(OS, Policy);
135 if (QTN->hasTemplateKeyword())
137 OS << *QTN->getDecl();
139 if (!SuppressNNS && DTN->getQualifier())
140 DTN->getQualifier()->print(OS, Policy);
143 if (DTN->isIdentifier())
144 OS << DTN->getIdentifier()->getName();
148 = getAsSubstTemplateTemplateParm()) {
149 subst->getReplacement().print(OS, Policy, SuppressNNS);
151 = getAsSubstTemplateTemplateParmPack())
152 OS << *SubstPack->getParameterPack();
155 (*OTS->
begin())->printName(OS);
162 raw_string_ostream OS(NameStr);
170 return DB << NameStr;
void print(raw_ostream &OS, const PrintingPolicy &Policy, bool SuppressNNS=false) const
Print the template name.
TemplateDecl * getAsTemplateDecl() const
Retrieve the underlying template declaration that this template name refers to, if known...
Defines the C++ template declaration subclasses.
const DiagnosticBuilder & operator<<(const DiagnosticBuilder &DB, const Attr *At)
void Profile(llvm::FoldingSetNodeID &ID, ASTContext &Context)
Describes how types, statements, expressions, and declarations should be printed. ...
Holds long-lived AST nodes (such as types and decls) that can be referred to throughout the semantic ...
Represents a dependent template name that cannot be resolved prior to template instantiation.
SubstTemplateTemplateParmStorage * getAsSubstTemplateTemplateParm()
Keeps track of the various options that can be enabled, which controls the dialect of C or C++ that i...
static void dump(llvm::raw_ostream &OS, StringRef FunctionName, ArrayRef< CounterExpression > Expressions, ArrayRef< CounterMappingRegion > Regions)
TemplateArgument getArgumentPack() const
Retrieve the template template argument pack with which this parameter was substituted.
void dump() const
Debugging aid that dumps the template name to standard error.
A little helper class used to produce diagnostics.
bool containsUnexpandedParameterPack() const
Determines whether this template name contains an unexpanded parameter pack (for C++0x variadic templ...
ID
Defines the set of possible language-specific address spaces.
Defines the clang::LangOptions interface.
bool isInstantiationDependent() const
Determines whether this is a template name that somehow depends on a template parameter.
void Profile(llvm::FoldingSetNodeID &ID)
A structure for storing the information associated with a substituted template template parameter...
Represents a C++ template name within the type system.
OverloadedTemplateStorage * getAsOverloadedStorage()
A structure for storing an already-substituted template template parameter pack.
void Profile(llvm::FoldingSetNodeID &ID, const ASTContext &Context) const
Used to insert TemplateArguments into FoldingSets.
Represents a template argument.
Represents a template name that was expressed as a qualified name.
void * getAsVoidPointer() const
Retrieve the template name as a void pointer.
The base class of all kinds of template declarations (e.g., class, function, etc.).
bool isDependent() const
Determines whether this is a dependent template name.
Defines the Diagnostic-related interfaces.
const char * getOperatorSpelling(OverloadedOperatorKind Operator)
Retrieve the spelling of the given overloaded operator, without the preceding "operator" keyword...
The parameter type of a method or function.
A structure for storing the information associated with an overloaded template name.
Implementation class used to describe either a set of overloaded template names or an already-substit...