23 #include "llvm/ADT/ArrayRef.h" 24 #include "llvm/ADT/FoldingSet.h" 25 #include "llvm/Support/Casting.h" 26 #include "llvm/Support/Compiler.h" 27 #include "llvm/Support/raw_ostream.h" 31 using namespace clang;
39 Profile(ID, Parameter, Replacement);
45 ID.AddPointer(parameter);
58 ID.AddPointer(Parameter);
63 Storage = StorageType::getFromOpaqueValue(Ptr);
104 return QTN->getTemplateDecl();
107 return sub->getReplacement().getAsTemplateDecl();
166 assert(Decl &&
"all declarations of template are friends");
173 if (isa<TemplateTemplateParmDecl>(
Template))
179 return Template->getDeclContext() &&
180 Template->getDeclContext()->isDependentContext();
184 "overloaded templates shouldn't survive to here");
191 if (QTN->getQualifier()->isInstantiationDependent())
200 if (QTN->getQualifier()->containsUnexpandedParameterPack())
206 = dyn_cast<TemplateTemplateParmDecl>(
Template))
207 return TTP->isParameterPack();
213 return DTN->getQualifier() &&
214 DTN->getQualifier()->containsUnexpandedParameterPack();
221 bool SuppressNNS)
const {
226 QTN->getQualifier()->print(OS, Policy);
227 if (QTN->hasTemplateKeyword())
229 OS << *QTN->getDecl();
231 if (!SuppressNNS && DTN->getQualifier())
232 DTN->getQualifier()->print(OS, Policy);
235 if (DTN->isIdentifier())
236 OS << DTN->getIdentifier()->getName();
241 subst->getReplacement().print(OS, Policy, SuppressNNS);
244 OS << *SubstPack->getParameterPack();
246 Assumed->getDeclName().print(OS, Policy);
249 (*OTS->
begin())->printName(OS);
256 llvm::raw_string_ostream OS(NameStr);
264 return DB << NameStr;
270 llvm::raw_string_ostream OS(NameStr);
278 return PD << NameStr;
void dump() const
Debugging aid that dumps the template name to standard error.
void * getAsVoidPointer() const
Retrieve the template name as a void pointer.
Decl - This represents one declaration (or definition), e.g.
Defines the C++ template declaration subclasses.
Decl * getPreviousDecl()
Retrieve the previous declaration that declares the same entity as this declaration, or NULL if there is no previous declaration.
const DiagnosticBuilder & operator<<(const DiagnosticBuilder &DB, const Attr *At)
A template template parameter that has been substituted for some other template name.
void Profile(llvm::FoldingSetNodeID &ID, ASTContext &Context)
void Profile(llvm::FoldingSetNodeID &ID, const ASTContext &Context) const
Used to insert TemplateArguments into FoldingSets.
QualifiedTemplateName * getAsQualifiedTemplateName() const
Retrieve the underlying qualified template name structure, if any.
Describes how types, statements, expressions, and declarations should be printed. ...
SubstTemplateTemplateParmStorage * getAsSubstTemplateTemplateParm() const
Retrieve the substituted template template parameter, if known.
void print(raw_ostream &OS, const PrintingPolicy &Policy, bool SuppressNNS=false) const
Print the template name.
TemplateName getNameToSubstitute() const
Get the template name to substitute when this template name is used as a template template argument...
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.
TemplateDecl * getAsTemplateDecl() const
Retrieve the underlying template declaration that this template name refers to, if known...
SubstTemplateTemplateParmPackStorage * getAsSubstTemplateTemplateParmPack() const
Retrieve the substituted template template parameter pack, if known.
SubstTemplateTemplateParmStorage * getAsSubstTemplateTemplateParm()
Keeps track of the various options that can be enabled, which controls the dialect of C or C++ that i...
A qualified template name, where the qualification is kept to describe the source code as written...
Forward-declares and imports various common LLVM datatypes that clang wants to use unqualified...
An unqualified-id that has been assumed to name a function template that will be found by ADL...
Defines the Diagnostic-related interfaces.
SubstTemplateTemplateParmPackStorage * getAsSubstTemplateTemplateParmPack()
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.
A dependent template name that has not been resolved to a template (or set of templates).
Defines the clang::LangOptions interface.
Defines an enumeration for C++ overloaded operators.
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.
TemplateTemplateParmDecl - Declares a template template parameter, e.g., "T" in.
FriendObjectKind getFriendObjectKind() const
Determines whether this declaration is the object of a friend declaration and, if so...
A template template parameter pack that has been substituted for a template template argument pack...
OverloadedTemplateStorage * getAsOverloadedStorage()
OverloadedTemplateStorage * getAsOverloadedTemplate() const
Retrieve the underlying, overloaded function template declarations that this template name refers to...
A structure for storing an already-substituted template template parameter pack.
DependentTemplateName * getAsDependentTemplateName() const
Retrieve the underlying dependent template name structure, if any.
Represents a template argument.
Represents a template name that was expressed as a qualified name.
bool isNull() const
Determine whether this template name is NULL.
Dataflow Directional Tag Classes.
AssumedTemplateStorage * getAsAssumedTemplateName()
The base class of all kinds of template declarations (e.g., class, function, etc.).
const char * getOperatorSpelling(OverloadedOperatorKind Operator)
Retrieve the spelling of the given overloaded operator, without the preceding "operator" keyword...
AssumedTemplateStorage * getAsAssumedTemplateName() const
Retrieve information on a name that has been assumed to be a template-name in order to permit a call ...
A structure for storing the information associated with an overloaded template name.
A structure for storing the information associated with a name that has been assumed to be a template...
NamedDecl * getMostRecentDecl()
TemplateArgument getArgumentPack() const
Retrieve the template template argument pack with which this parameter was substituted.
A set of overloaded template declarations.
Implementation class used to describe either a set of overloaded template names or an already-substit...
bool isDependent() const
Determines whether this is a dependent template name.
A single template declaration.
bool isInstantiationDependent() const
Determines whether this is a template name that somehow depends on a template parameter.