24 #include "llvm/ADT/ArrayRef.h" 25 #include "llvm/ADT/FoldingSet.h" 26 #include "llvm/Support/Casting.h" 27 #include "llvm/Support/Compiler.h" 28 #include "llvm/Support/raw_ostream.h" 32 using namespace clang;
46 ID.AddPointer(parameter);
59 ID.AddPointer(Parameter);
64 Storage = StorageType::getFromOpaqueValue(Ptr);
101 return QTN->getTemplateDecl();
104 return sub->getReplacement().getAsTemplateDecl();
155 assert(Decl &&
"all declarations of template are friends");
162 if (isa<TemplateTemplateParmDecl>(
Template))
168 return Template->getDeclContext() &&
169 Template->getDeclContext()->isDependentContext();
173 "overloaded templates shouldn't survive to here");
180 if (QTN->getQualifier()->isInstantiationDependent())
190 = dyn_cast<TemplateTemplateParmDecl>(
Template))
191 return TTP->isParameterPack();
197 return DTN->getQualifier() &&
198 DTN->getQualifier()->containsUnexpandedParameterPack();
205 bool SuppressNNS)
const {
210 QTN->getQualifier()->print(OS, Policy);
211 if (QTN->hasTemplateKeyword())
213 OS << *QTN->getDecl();
215 if (!SuppressNNS && DTN->getQualifier())
216 DTN->getQualifier()->print(OS, Policy);
219 if (DTN->isIdentifier())
220 OS << DTN->getIdentifier()->getName();
225 subst->getReplacement().print(OS, Policy, SuppressNNS);
228 OS << *SubstPack->getParameterPack();
231 (*OTS->
begin())->printName(OS);
238 llvm::raw_string_ostream OS(NameStr);
246 return DB << 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...
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.
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.
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...
A structure for storing the information associated with an overloaded template name.
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.