clang  14.0.0git
TemplateName.h
Go to the documentation of this file.
1 //===- TemplateName.h - C++ Template Name Representation --------*- C++ -*-===//
2 //
3 // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
4 // See https://llvm.org/LICENSE.txt for license information.
5 // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
6 //
7 //===----------------------------------------------------------------------===//
8 //
9 // This file defines the TemplateName interface and subclasses.
10 //
11 //===----------------------------------------------------------------------===//
12 
13 #ifndef LLVM_CLANG_AST_TEMPLATENAME_H
14 #define LLVM_CLANG_AST_TEMPLATENAME_H
15 
18 #include "clang/Basic/LLVM.h"
19 #include "llvm/ADT/FoldingSet.h"
20 #include "llvm/ADT/PointerIntPair.h"
21 #include "llvm/ADT/PointerUnion.h"
22 #include "llvm/Support/PointerLikeTypeTraits.h"
23 #include <cassert>
24 
25 namespace clang {
26 
27 class ASTContext;
28 class DependentTemplateName;
29 class DiagnosticBuilder;
30 class IdentifierInfo;
31 class NamedDecl;
32 class NestedNameSpecifier;
34 class OverloadedTemplateStorage;
35 class AssumedTemplateStorage;
36 class PartialDiagnostic;
37 struct PrintingPolicy;
38 class QualifiedTemplateName;
39 class SubstTemplateTemplateParmPackStorage;
40 class SubstTemplateTemplateParmStorage;
41 class TemplateArgument;
42 class TemplateDecl;
43 class TemplateTemplateParmDecl;
44 
45 /// Implementation class used to describe either a set of overloaded
46 /// template names or an already-substituted template template parameter pack.
48 protected:
49  enum Kind {
51  Assumed, // defined in DeclarationName.h
54  };
55 
56  struct BitsTag {
57  /// A Kind.
58  unsigned Kind : 2;
59 
60  /// The number of stored templates or template arguments,
61  /// depending on which subclass we have.
62  unsigned Size : 30;
63  };
64 
65  union {
66  struct BitsTag Bits;
68  };
69 
71  Bits.Kind = kind;
72  Bits.Size = size;
73  }
74 
75 public:
76  unsigned size() const { return Bits.Size; }
77 
79  return Bits.Kind == Overloaded
80  ? reinterpret_cast<OverloadedTemplateStorage *>(this)
81  : nullptr;
82  }
83 
85  return Bits.Kind == Assumed
86  ? reinterpret_cast<AssumedTemplateStorage *>(this)
87  : nullptr;
88  }
89 
92  ? reinterpret_cast<SubstTemplateTemplateParmStorage *>(this)
93  : nullptr;
94  }
95 
98  ? reinterpret_cast<SubstTemplateTemplateParmPackStorage *>(this)
99  : nullptr;
100  }
101 };
102 
103 /// A structure for storing the information associated with an
104 /// overloaded template name.
106  friend class ASTContext;
107 
110 
111  NamedDecl **getStorage() {
112  return reinterpret_cast<NamedDecl **>(this + 1);
113  }
114  NamedDecl * const *getStorage() const {
115  return reinterpret_cast<NamedDecl *const *>(this + 1);
116  }
117 
118 public:
119  using iterator = NamedDecl *const *;
120 
121  iterator begin() const { return getStorage(); }
122  iterator end() const { return getStorage() + size(); }
123 
125  return llvm::makeArrayRef(begin(), end());
126  }
127 };
128 
129 /// A structure for storing an already-substituted template template
130 /// parameter pack.
131 ///
132 /// This kind of template names occurs when the parameter pack has been
133 /// provided with a template template argument pack in a context where its
134 /// enclosing pack expansion could not be fully expanded.
136  : public UncommonTemplateNameStorage, public llvm::FoldingSetNode
137 {
138  TemplateTemplateParmDecl *Parameter;
139  const TemplateArgument *Arguments;
140 
141 public:
143  unsigned Size,
144  const TemplateArgument *Arguments)
146  Parameter(Parameter), Arguments(Arguments) {}
147 
148  /// Retrieve the template template parameter pack being substituted.
150  return Parameter;
151  }
152 
153  /// Retrieve the template template argument pack with which this
154  /// parameter was substituted.
156 
157  void Profile(llvm::FoldingSetNodeID &ID, ASTContext &Context);
158 
159  static void Profile(llvm::FoldingSetNodeID &ID,
160  ASTContext &Context,
161  TemplateTemplateParmDecl *Parameter,
162  const TemplateArgument &ArgPack);
163 };
164 
165 /// Represents a C++ template name within the type system.
166 ///
167 /// A C++ template name refers to a template within the C++ type
168 /// system. In most cases, a template name is simply a reference to a
169 /// class template, e.g.
170 ///
171 /// \code
172 /// template<typename T> class X { };
173 ///
174 /// X<int> xi;
175 /// \endcode
176 ///
177 /// Here, the 'X' in \c X<int> is a template name that refers to the
178 /// declaration of the class template X, above. Template names can
179 /// also refer to function templates, C++0x template aliases, etc.
180 ///
181 /// Some template names are dependent. For example, consider:
182 ///
183 /// \code
184 /// template<typename MetaFun, typename T1, typename T2> struct apply2 {
185 /// typedef typename MetaFun::template apply<T1, T2>::type type;
186 /// };
187 /// \endcode
188 ///
189 /// Here, "apply" is treated as a template name within the typename
190 /// specifier in the typedef. "apply" is a nested template, and can
191 /// only be understood in the context of
193  using StorageType =
194  llvm::PointerUnion<TemplateDecl *, UncommonTemplateNameStorage *,
196 
197  StorageType Storage;
198 
199  explicit TemplateName(void *Ptr);
200 
201 public:
202  // Kind of name that is actually stored.
203  enum NameKind {
204  /// A single template declaration.
206 
207  /// A set of overloaded template declarations.
209 
210  /// An unqualified-id that has been assumed to name a function template
211  /// that will be found by ADL.
213 
214  /// A qualified template name, where the qualification is kept
215  /// to describe the source code as written.
217 
218  /// A dependent template name that has not been resolved to a
219  /// template (or set of templates).
221 
222  /// A template template parameter that has been substituted
223  /// for some other template name.
225 
226  /// A template template parameter pack that has been substituted for
227  /// a template template argument pack, but has not yet been expanded into
228  /// individual arguments.
230  };
231 
232  TemplateName() = default;
234  explicit TemplateName(OverloadedTemplateStorage *Storage);
235  explicit TemplateName(AssumedTemplateStorage *Storage);
238  explicit TemplateName(QualifiedTemplateName *Qual);
239  explicit TemplateName(DependentTemplateName *Dep);
240 
241  /// Determine whether this template name is NULL.
242  bool isNull() const;
243 
244  // Get the kind of name that is actually stored.
245  NameKind getKind() const;
246 
247  /// Retrieve the underlying template declaration that
248  /// this template name refers to, if known.
249  ///
250  /// \returns The template declaration that this template name refers
251  /// to, if any. If the template name does not refer to a specific
252  /// declaration because it is a dependent name, or if it refers to a
253  /// set of function templates, returns NULL.
255 
256  /// Retrieve the underlying, overloaded function template
257  /// declarations that this template name refers to, if known.
258  ///
259  /// \returns The set of overloaded function templates that this template
260  /// name refers to, if known. If the template name does not refer to a
261  /// specific set of function templates because it is a dependent name or
262  /// refers to a single template, returns NULL.
264 
265  /// Retrieve information on a name that has been assumed to be a
266  /// template-name in order to permit a call via ADL.
268 
269  /// Retrieve the substituted template template parameter, if
270  /// known.
271  ///
272  /// \returns The storage for the substituted template template parameter,
273  /// if known. Otherwise, returns NULL.
275 
276  /// Retrieve the substituted template template parameter pack, if
277  /// known.
278  ///
279  /// \returns The storage for the substituted template template parameter pack,
280  /// if known. Otherwise, returns NULL.
283 
284  /// Retrieve the underlying qualified template name
285  /// structure, if any.
287 
288  /// Retrieve the underlying dependent template name
289  /// structure, if any.
291 
292  TemplateName getUnderlying() const;
293 
294  /// Get the template name to substitute when this template name is used as a
295  /// template template argument. This refers to the most recent declaration of
296  /// the template, including any default template arguments.
298 
299  TemplateNameDependence getDependence() const;
300 
301  /// Determines whether this is a dependent template name.
302  bool isDependent() const;
303 
304  /// Determines whether this is a template name that somehow
305  /// depends on a template parameter.
306  bool isInstantiationDependent() const;
307 
308  /// Determines whether this template name contains an
309  /// unexpanded parameter pack (for C++0x variadic templates).
310  bool containsUnexpandedParameterPack() const;
311 
312  enum class Qualified { None, AsWritten, Fully };
313  /// Print the template name.
314  ///
315  /// \param OS the output stream to which the template name will be
316  /// printed.
317  ///
318  /// \param Qual print the (Qualified::None) simple name,
319  /// (Qualified::AsWritten) any written (possibly partial) qualifier, or
320  /// (Qualified::Fully) the fully qualified name.
321  void print(raw_ostream &OS, const PrintingPolicy &Policy,
322  Qualified Qual = Qualified::AsWritten) const;
323 
324  /// Debugging aid that dumps the template name.
325  void dump(raw_ostream &OS) const;
326 
327  /// Debugging aid that dumps the template name to standard
328  /// error.
329  void dump() const;
330 
331  void Profile(llvm::FoldingSetNodeID &ID) {
332  ID.AddPointer(Storage.getOpaqueValue());
333  }
334 
335  /// Retrieve the template name as a void pointer.
336  void *getAsVoidPointer() const { return Storage.getOpaqueValue(); }
337 
338  /// Build a template name from a void pointer.
339  static TemplateName getFromVoidPointer(void *Ptr) {
340  return TemplateName(Ptr);
341  }
342 };
343 
344 /// Insertion operator for diagnostics. This allows sending TemplateName's
345 /// into a diagnostic with <<.
346 const StreamingDiagnostic &operator<<(const StreamingDiagnostic &DB,
347  TemplateName N);
348 
349 /// A structure for storing the information associated with a
350 /// substituted template template parameter.
352  : public UncommonTemplateNameStorage, public llvm::FoldingSetNode {
353  friend class ASTContext;
354 
355  TemplateTemplateParmDecl *Parameter;
356  TemplateName Replacement;
357 
359  TemplateName replacement)
361  Parameter(parameter), Replacement(replacement) {}
362 
363 public:
365  TemplateName getReplacement() const { return Replacement; }
366 
367  void Profile(llvm::FoldingSetNodeID &ID);
368 
369  static void Profile(llvm::FoldingSetNodeID &ID,
370  TemplateTemplateParmDecl *parameter,
371  TemplateName replacement);
372 };
373 
377  return subst->getReplacement().getUnderlying();
378  return *this;
379 }
380 
381 /// Represents a template name that was expressed as a
382 /// qualified name.
383 ///
384 /// This kind of template name refers to a template name that was
385 /// preceded by a nested name specifier, e.g., \c std::vector. Here,
386 /// the nested name specifier is "std::" and the template name is the
387 /// declaration for "vector". The QualifiedTemplateName class is only
388 /// used to provide "sugar" for template names that were expressed
389 /// with a qualified name, and has no semantic meaning. In this
390 /// manner, it is to TemplateName what ElaboratedType is to Type,
391 /// providing extra syntactic sugar for downstream clients.
392 class QualifiedTemplateName : public llvm::FoldingSetNode {
393  friend class ASTContext;
394 
395  /// The nested name specifier that qualifies the template name.
396  ///
397  /// The bit is used to indicate whether the "template" keyword was
398  /// present before the template name itself. Note that the
399  /// "template" keyword is always redundant in this case (otherwise,
400  /// the template name would be a dependent name and we would express
401  /// this name with DependentTemplateName).
402  llvm::PointerIntPair<NestedNameSpecifier *, 1> Qualifier;
403 
404  /// The template declaration or set of overloaded function templates
405  /// that this qualified name refers to.
406  TemplateDecl *Template;
407 
408  QualifiedTemplateName(NestedNameSpecifier *NNS, bool TemplateKeyword,
409  TemplateDecl *Template)
410  : Qualifier(NNS, TemplateKeyword? 1 : 0), Template(Template) {}
411 
412 public:
413  /// Return the nested name specifier that qualifies this name.
414  NestedNameSpecifier *getQualifier() const { return Qualifier.getPointer(); }
415 
416  /// Whether the template name was prefixed by the "template"
417  /// keyword.
418  bool hasTemplateKeyword() const { return Qualifier.getInt(); }
419 
420  /// The template declaration that this qualified name refers
421  /// to.
422  TemplateDecl *getDecl() const { return Template; }
423 
424  /// The template declaration to which this qualified name
425  /// refers.
426  TemplateDecl *getTemplateDecl() const { return Template; }
427 
428  void Profile(llvm::FoldingSetNodeID &ID) {
430  }
431 
432  static void Profile(llvm::FoldingSetNodeID &ID, NestedNameSpecifier *NNS,
433  bool TemplateKeyword, TemplateDecl *Template) {
434  ID.AddPointer(NNS);
435  ID.AddBoolean(TemplateKeyword);
436  ID.AddPointer(Template);
437  }
438 };
439 
440 /// Represents a dependent template name that cannot be
441 /// resolved prior to template instantiation.
442 ///
443 /// This kind of template name refers to a dependent template name,
444 /// including its nested name specifier (if any). For example,
445 /// DependentTemplateName can refer to "MetaFun::template apply",
446 /// where "MetaFun::" is the nested name specifier and "apply" is the
447 /// template name referenced. The "template" keyword is implied.
448 class DependentTemplateName : public llvm::FoldingSetNode {
449  friend class ASTContext;
450 
451  /// The nested name specifier that qualifies the template
452  /// name.
453  ///
454  /// The bit stored in this qualifier describes whether the \c Name field
455  /// is interpreted as an IdentifierInfo pointer (when clear) or as an
456  /// overloaded operator kind (when set).
457  llvm::PointerIntPair<NestedNameSpecifier *, 1, bool> Qualifier;
458 
459  /// The dependent template name.
460  union {
461  /// The identifier template name.
462  ///
463  /// Only valid when the bit on \c Qualifier is clear.
465 
466  /// The overloaded operator name.
467  ///
468  /// Only valid when the bit on \c Qualifier is set.
470  };
471 
472  /// The canonical template name to which this dependent
473  /// template name refers.
474  ///
475  /// The canonical template name for a dependent template name is
476  /// another dependent template name whose nested name specifier is
477  /// canonical.
478  TemplateName CanonicalTemplateName;
479 
481  const IdentifierInfo *Identifier)
482  : Qualifier(Qualifier, false), Identifier(Identifier),
483  CanonicalTemplateName(this) {}
484 
485  DependentTemplateName(NestedNameSpecifier *Qualifier,
486  const IdentifierInfo *Identifier,
487  TemplateName Canon)
488  : Qualifier(Qualifier, false), Identifier(Identifier),
489  CanonicalTemplateName(Canon) {}
490 
491  DependentTemplateName(NestedNameSpecifier *Qualifier,
494  CanonicalTemplateName(this) {}
495 
496  DependentTemplateName(NestedNameSpecifier *Qualifier,
498  TemplateName Canon)
500  CanonicalTemplateName(Canon) {}
501 
502 public:
503  /// Return the nested name specifier that qualifies this name.
504  NestedNameSpecifier *getQualifier() const { return Qualifier.getPointer(); }
505 
506  /// Determine whether this template name refers to an identifier.
507  bool isIdentifier() const { return !Qualifier.getInt(); }
508 
509  /// Returns the identifier to which this template name refers.
510  const IdentifierInfo *getIdentifier() const {
511  assert(isIdentifier() && "Template name isn't an identifier?");
512  return Identifier;
513  }
514 
515  /// Determine whether this template name refers to an overloaded
516  /// operator.
517  bool isOverloadedOperator() const { return Qualifier.getInt(); }
518 
519  /// Return the overloaded operator to which this template name refers.
521  assert(isOverloadedOperator() &&
522  "Template name isn't an overloaded operator?");
523  return Operator;
524  }
525 
526  void Profile(llvm::FoldingSetNodeID &ID) {
527  if (isIdentifier())
529  else
531  }
532 
533  static void Profile(llvm::FoldingSetNodeID &ID, NestedNameSpecifier *NNS,
534  const IdentifierInfo *Identifier) {
535  ID.AddPointer(NNS);
536  ID.AddBoolean(false);
537  ID.AddPointer(Identifier);
538  }
539 
540  static void Profile(llvm::FoldingSetNodeID &ID, NestedNameSpecifier *NNS,
542  ID.AddPointer(NNS);
543  ID.AddBoolean(true);
544  ID.AddInteger(Operator);
545  }
546 };
547 
548 } // namespace clang.
549 
550 namespace llvm {
551 
552 /// The clang::TemplateName class is effectively a pointer.
553 template<>
554 struct PointerLikeTypeTraits<clang::TemplateName> {
555  static inline void *getAsVoidPointer(clang::TemplateName TN) {
556  return TN.getAsVoidPointer();
557  }
558 
559  static inline clang::TemplateName getFromVoidPointer(void *Ptr) {
561  }
562 
563  // No bits are available!
564  static constexpr int NumLowBitsAvailable = 0;
565 };
566 
567 } // namespace llvm.
568 
569 #endif // LLVM_CLANG_AST_TEMPLATENAME_H
clang::DependentTemplateName::isOverloadedOperator
bool isOverloadedOperator() const
Determine whether this template name refers to an overloaded operator.
Definition: TemplateName.h:517
clang::TemplateName::Qualified::AsWritten
@ AsWritten
clang::SubstTemplateTemplateParmPackStorage::getArgumentPack
TemplateArgument getArgumentPack() const
Retrieve the template template argument pack with which this parameter was substituted.
Definition: TemplateName.cpp:36
llvm
Definition: Dominators.h:30
clang::TemplateName::isInstantiationDependent
bool isInstantiationDependent() const
Determines whether this is a template name that somehow depends on a template parameter.
Definition: TemplateName.cpp:215
clang::TemplateName::Qualified::Fully
@ Fully
clang::TemplateName::getAsSubstTemplateTemplateParm
SubstTemplateTemplateParmStorage * getAsSubstTemplateTemplateParm() const
Retrieve the substituted template template parameter, if known.
Definition: TemplateName.cpp:131
clang::UncommonTemplateNameStorage::SubstTemplateTemplateParm
@ SubstTemplateTemplateParm
Definition: TemplateName.h:52
getStorage
static llvm::GlobalValue::DLLStorageClassTypes getStorage(CodeGenModule &CGM, StringRef Name)
Definition: CGObjCMac.cpp:6451
clang::ObjCSubstitutionContext::Parameter
@ Parameter
The parameter type of a method or function.
clang::TemplateName::containsUnexpandedParameterPack
bool containsUnexpandedParameterPack() const
Determines whether this template name contains an unexpanded parameter pack (for C++0x variadic templ...
Definition: TemplateName.cpp:219
llvm::PointerLikeTypeTraits< clang::TemplateName >::getFromVoidPointer
static clang::TemplateName getFromVoidPointer(void *Ptr)
Definition: TemplateName.h:559
DependenceFlags.h
clang::TemplateName::Qualified::None
@ None
clang::UncommonTemplateNameStorage::getAsAssumedTemplateName
AssumedTemplateStorage * getAsAssumedTemplateName()
Definition: TemplateName.h:84
clang::NamedDecl
This represents a decl that may have a name.
Definition: Decl.h:249
clang::UncommonTemplateNameStorage::BitsTag
Definition: TemplateName.h:56
clang::DependentTemplateName::Profile
static void Profile(llvm::FoldingSetNodeID &ID, NestedNameSpecifier *NNS, OverloadedOperatorKind Operator)
Definition: TemplateName.h:540
clang::TemplateName::getAsTemplateDecl
TemplateDecl * getAsTemplateDecl() const
Retrieve the underlying template declaration that this template name refers to, if known.
Definition: TemplateName.cpp:101
clang::QualifiedTemplateName::getQualifier
NestedNameSpecifier * getQualifier() const
Return the nested name specifier that qualifies this name.
Definition: TemplateName.h:414
clang::NestedNameSpecifier
Represents a C++ nested name specifier, such as "\::std::vector<int>::".
Definition: NestedNameSpecifier.h:50
clang::OverloadedTemplateStorage
A structure for storing the information associated with an overloaded template name.
Definition: TemplateName.h:105
int
__device__ int
Definition: __clang_hip_libdevice_declares.h:63
clang::TemplateName::getDependence
TemplateNameDependence getDependence() const
Definition: TemplateName.cpp:173
clang::TemplateName::getAsOverloadedTemplate
OverloadedTemplateStorage * getAsOverloadedTemplate() const
Retrieve the underlying, overloaded function template declarations that this template name refers to,...
Definition: TemplateName.cpp:114
clang::QualifiedTemplateName::getDecl
TemplateDecl * getDecl() const
The template declaration that this qualified name refers to.
Definition: TemplateName.h:422
clang::PrintingPolicy
Describes how types, statements, expressions, and declarations should be printed.
Definition: PrettyPrinter.h:59
clang::UncommonTemplateNameStorage::Overloaded
@ Overloaded
Definition: TemplateName.h:50
clang::UncommonTemplateNameStorage::getAsOverloadedStorage
OverloadedTemplateStorage * getAsOverloadedStorage()
Definition: TemplateName.h:78
clang::TemplateName::getNameToSubstitute
TemplateName getNameToSubstitute() const
Get the template name to substitute when this template name is used as a template template argument.
Definition: TemplateName.cpp:156
clang::UncommonTemplateNameStorage::BitsTag::Kind
unsigned Kind
A Kind.
Definition: TemplateName.h:58
clang::UncommonTemplateNameStorage::UncommonTemplateNameStorage
UncommonTemplateNameStorage(Kind kind, unsigned size)
Definition: TemplateName.h:70
clang::QualifiedTemplateName::Profile
void Profile(llvm::FoldingSetNodeID &ID)
Definition: TemplateName.h:428
clang::TemplateName::isDependent
bool isDependent() const
Determines whether this is a dependent template name.
Definition: TemplateName.cpp:211
clang::OverloadedTemplateStorage::decls
llvm::ArrayRef< NamedDecl * > decls() const
Definition: TemplateName.h:124
clang::ASTContext
Holds long-lived AST nodes (such as types and decls) that can be referred to throughout the semantic ...
Definition: ASTContext.h:212
clang::SubstTemplateTemplateParmPackStorage::getParameterPack
TemplateTemplateParmDecl * getParameterPack() const
Retrieve the template template parameter pack being substituted.
Definition: TemplateName.h:149
clang::OverloadedTemplateStorage::begin
iterator begin() const
Definition: TemplateName.h:121
clang::OverloadedTemplateStorage::end
iterator end() const
Definition: TemplateName.h:122
NestedNameSpecifier.h
clang::syntax::NodeRole::Qualifier
@ Qualifier
clang::DependentTemplateName::isIdentifier
bool isIdentifier() const
Determine whether this template name refers to an identifier.
Definition: TemplateName.h:507
clang::TemplateName::getUnderlying
TemplateName getUnderlying() const
Definition: TemplateName.h:374
clang::DependentTemplateName::Operator
OverloadedOperatorKind Operator
The overloaded operator name.
Definition: TemplateName.h:469
clang::TemplateArgument
Represents a template argument.
Definition: TemplateBase.h:62
clang::TemplateName::getAsAssumedTemplateName
AssumedTemplateStorage * getAsAssumedTemplateName() const
Retrieve information on a name that has been assumed to be a template-name in order to permit a call ...
Definition: TemplateName.cpp:122
clang::TemplateTemplateParmDecl
TemplateTemplateParmDecl - Declares a template template parameter, e.g., "T" in.
Definition: DeclTemplate.h:1601
clang::TemplateName::Template
@ Template
A single template declaration.
Definition: TemplateName.h:205
clang::TemplateName::SubstTemplateTemplateParmPack
@ SubstTemplateTemplateParmPack
A template template parameter pack that has been substituted for a template template argument pack,...
Definition: TemplateName.h:229
clang::SubstTemplateTemplateParmPackStorage
A structure for storing an already-substituted template template parameter pack.
Definition: TemplateName.h:135
clang::operator<<
const StreamingDiagnostic & operator<<(const StreamingDiagnostic &DB, const ASTContext::SectionInfo &Section)
Insertion operator for diagnostics.
Definition: ASTContext.cpp:11774
clang::QualifiedTemplateName::hasTemplateKeyword
bool hasTemplateKeyword() const
Whether the template name was prefixed by the "template" keyword.
Definition: TemplateName.h:418
clang::QualifiedTemplateName::Profile
static void Profile(llvm::FoldingSetNodeID &ID, NestedNameSpecifier *NNS, bool TemplateKeyword, TemplateDecl *Template)
Definition: TemplateName.h:432
clang::TemplateName::isNull
bool isNull() const
Determine whether this template name is NULL.
Definition: TemplateName.cpp:80
clang::OverloadedOperatorKind
OverloadedOperatorKind
Enumeration specifying the different kinds of C++ overloaded operators.
Definition: OperatorKinds.h:21
clang::TemplateName::TemplateName
TemplateName()=default
clang::DependentTemplateName::Profile
static void Profile(llvm::FoldingSetNodeID &ID, NestedNameSpecifier *NNS, const IdentifierInfo *Identifier)
Definition: TemplateName.h:533
clang::UncommonTemplateNameStorage
Implementation class used to describe either a set of overloaded template names or an already-substit...
Definition: TemplateName.h:47
clang::DependentTemplateName
Represents a dependent template name that cannot be resolved prior to template instantiation.
Definition: TemplateName.h:448
clang::UncommonTemplateNameStorage::SubstTemplateTemplateParmPack
@ SubstTemplateTemplateParmPack
Definition: TemplateName.h:53
clang::TemplateName::getKind
NameKind getKind() const
Definition: TemplateName.cpp:82
clang::TemplateName::getAsQualifiedTemplateName
QualifiedTemplateName * getAsQualifiedTemplateName() const
Retrieve the underlying qualified template name structure, if any.
Definition: TemplateName.cpp:148
clang::UncommonTemplateNameStorage::Kind
Kind
Definition: TemplateName.h:49
clang::TemplateName::getAsVoidPointer
void * getAsVoidPointer() const
Retrieve the template name as a void pointer.
Definition: TemplateName.h:336
clang::TemplateName::QualifiedTemplate
@ QualifiedTemplate
A qualified template name, where the qualification is kept to describe the source code as written.
Definition: TemplateName.h:216
false
#define false
Definition: stdbool.h:17
clang::TemplateName
Represents a C++ template name within the type system.
Definition: TemplateName.h:192
clang::TemplateDecl
The base class of all kinds of template declarations (e.g., class, function, etc.).
Definition: DeclTemplate.h:399
llvm::ArrayRef
Definition: LLVM.h:34
clang::UncommonTemplateNameStorage::PointerAlignment
void * PointerAlignment
Definition: TemplateName.h:67
clang::TemplateName::dump
void dump() const
Debugging aid that dumps the template name to standard error.
Definition: TemplateName.cpp:287
clang::DependentTemplateName::getIdentifier
const IdentifierInfo * getIdentifier() const
Returns the identifier to which this template name refers.
Definition: TemplateName.h:510
llvm::PointerLikeTypeTraits< clang::TemplateName >::getAsVoidPointer
static void * getAsVoidPointer(clang::TemplateName TN)
Definition: TemplateName.h:555
clang::QualifiedTemplateName
Represents a template name that was expressed as a qualified name.
Definition: TemplateName.h:392
LLVM.h
clang::UncommonTemplateNameStorage::getAsSubstTemplateTemplateParmPack
SubstTemplateTemplateParmPackStorage * getAsSubstTemplateTemplateParmPack()
Definition: TemplateName.h:96
clang::TemplateName::getFromVoidPointer
static TemplateName getFromVoidPointer(void *Ptr)
Build a template name from a void pointer.
Definition: TemplateName.h:339
clang::IdentifierInfo
One of these records is kept for each identifier that is lexed.
Definition: IdentifierTable.h:84
clang::OverloadedTemplateStorage::iterator
NamedDecl *const * iterator
Definition: TemplateName.h:119
clang::SubstTemplateTemplateParmPackStorage::SubstTemplateTemplateParmPackStorage
SubstTemplateTemplateParmPackStorage(TemplateTemplateParmDecl *Parameter, unsigned Size, const TemplateArgument *Arguments)
Definition: TemplateName.h:142
clang::TemplateName::SubstTemplateTemplateParm
@ SubstTemplateTemplateParm
A template template parameter that has been substituted for some other template name.
Definition: TemplateName.h:224
clang::TemplateName::print
void print(raw_ostream &OS, const PrintingPolicy &Policy, Qualified Qual=Qualified::AsWritten) const
Print the template name.
Definition: TemplateName.cpp:223
clang::Builtin::ID
ID
Definition: Builtins.h:48
clang::SubstTemplateTemplateParmStorage
A structure for storing the information associated with a substituted template template parameter.
Definition: TemplateName.h:351
clang
Definition: CalledOnceCheck.h:17
clang::TemplateName::Profile
void Profile(llvm::FoldingSetNodeID &ID)
Definition: TemplateName.h:331
clang::UncommonTemplateNameStorage::BitsTag::Size
unsigned Size
The number of stored templates or template arguments, depending on which subclass we have.
Definition: TemplateName.h:62
clang::TemplateName::AssumedTemplate
@ AssumedTemplate
An unqualified-id that has been assumed to name a function template that will be found by ADL.
Definition: TemplateName.h:212
clang::UncommonTemplateNameStorage::size
unsigned size() const
Definition: TemplateName.h:76
llvm::PointerLikeTypeTraits
Definition: DeclGroup.h:139
clang::TemplateName::getAsDependentTemplateName
DependentTemplateName * getAsDependentTemplateName() const
Retrieve the underlying dependent template name structure, if any.
Definition: TemplateName.cpp:152
clang::SubstTemplateTemplateParmPackStorage::Profile
void Profile(llvm::FoldingSetNodeID &ID, ASTContext &Context)
Definition: TemplateName.cpp:51
clang::TemplateName::OverloadedTemplate
@ OverloadedTemplate
A set of overloaded template declarations.
Definition: TemplateName.h:208
clang::UncommonTemplateNameStorage::getAsSubstTemplateTemplateParm
SubstTemplateTemplateParmStorage * getAsSubstTemplateTemplateParm()
Definition: TemplateName.h:90
clang::TemplateName::Qualified
Qualified
Definition: TemplateName.h:312
clang::TemplateName::NameKind
NameKind
Definition: TemplateName.h:203
clang::SubstTemplateTemplateParmStorage::Profile
void Profile(llvm::FoldingSetNodeID &ID)
Definition: TemplateName.cpp:40
clang::TemplateName::getAsSubstTemplateTemplateParmPack
SubstTemplateTemplateParmPackStorage * getAsSubstTemplateTemplateParmPack() const
Retrieve the substituted template template parameter pack, if known.
Definition: TemplateName.cpp:140
clang::AssumedTemplateStorage
A structure for storing the information associated with a name that has been assumed to be a template...
Definition: DeclarationName.h:931
clang::UncommonTemplateNameStorage::Bits
struct BitsTag Bits
Definition: TemplateName.h:66
true
#define true
Definition: stdbool.h:16
clang::DependentTemplateName::getOperator
OverloadedOperatorKind getOperator() const
Return the overloaded operator to which this template name refers.
Definition: TemplateName.h:520
clang::DependentTemplateName::getQualifier
NestedNameSpecifier * getQualifier() const
Return the nested name specifier that qualifies this name.
Definition: TemplateName.h:504
clang::SubstTemplateTemplateParmStorage::getReplacement
TemplateName getReplacement() const
Definition: TemplateName.h:365
clang::DependentTemplateName::Profile
void Profile(llvm::FoldingSetNodeID &ID)
Definition: TemplateName.h:526
clang::DependentTemplateName::Identifier
const IdentifierInfo * Identifier
The identifier template name.
Definition: TemplateName.h:464
clang::diag::kind
unsigned kind
All of the diagnostics that can be emitted by the frontend.
Definition: DiagnosticIDs.h:62
clang::UncommonTemplateNameStorage::Assumed
@ Assumed
Definition: TemplateName.h:51
clang::SubstTemplateTemplateParmStorage::getParameter
TemplateTemplateParmDecl * getParameter() const
Definition: TemplateName.h:364
clang::QualifiedTemplateName::getTemplateDecl
TemplateDecl * getTemplateDecl() const
The template declaration to which this qualified name refers.
Definition: TemplateName.h:426
clang::TemplateName::DependentTemplate
@ DependentTemplate
A dependent template name that has not been resolved to a template (or set of templates).
Definition: TemplateName.h:220