clang 20.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#include <optional>
25
26namespace clang {
27
28class ASTContext;
29class Decl;
30class DependentTemplateName;
31class IdentifierInfo;
32class NamedDecl;
33class NestedNameSpecifier;
35class OverloadedTemplateStorage;
36class AssumedTemplateStorage;
37struct PrintingPolicy;
38class QualifiedTemplateName;
39class SubstTemplateTemplateParmPackStorage;
40class SubstTemplateTemplateParmStorage;
41class TemplateArgument;
42class TemplateDecl;
43class TemplateTemplateParmDecl;
44class UsingShadowDecl;
45
46/// Implementation class used to describe either a set of overloaded
47/// template names or an already-substituted template template parameter pack.
49protected:
50 enum Kind {
52 Assumed, // defined in DeclarationName.h
55 };
56
57 struct BitsTag {
58 LLVM_PREFERRED_TYPE(Kind)
60
61 // The template parameter index.
62 unsigned Index : 15;
63
64 /// The pack index, or the number of stored templates
65 /// or template arguments, depending on which subclass we have.
66 unsigned Data : 15;
67 };
68
69 union {
70 struct BitsTag Bits;
72 };
73
75 Bits.Kind = Kind;
77 Bits.Data = Data;
78 }
79
80public:
82 return Bits.Kind == Overloaded
83 ? reinterpret_cast<OverloadedTemplateStorage *>(this)
84 : nullptr;
85 }
86
88 return Bits.Kind == Assumed
89 ? reinterpret_cast<AssumedTemplateStorage *>(this)
90 : nullptr;
91 }
92
95 ? reinterpret_cast<SubstTemplateTemplateParmStorage *>(this)
96 : nullptr;
97 }
98
101 ? reinterpret_cast<SubstTemplateTemplateParmPackStorage *>(this)
102 : nullptr;
103 }
104};
105
106/// A structure for storing the information associated with an
107/// overloaded template name.
109 friend class ASTContext;
110
111 OverloadedTemplateStorage(unsigned size)
112 : UncommonTemplateNameStorage(Overloaded, 0, size) {}
113
115 return reinterpret_cast<NamedDecl **>(this + 1);
116 }
117 NamedDecl * const *getStorage() const {
118 return reinterpret_cast<NamedDecl *const *>(this + 1);
119 }
120
121public:
122 unsigned size() const { return Bits.Data; }
123
124 using iterator = NamedDecl *const *;
125
126 iterator begin() const { return getStorage(); }
127 iterator end() const { return getStorage() + Bits.Data; }
128
130 return llvm::ArrayRef(begin(), end());
131 }
132};
133
134/// A structure for storing an already-substituted template template
135/// parameter pack.
136///
137/// This kind of template names occurs when the parameter pack has been
138/// provided with a template template argument pack in a context where its
139/// enclosing pack expansion could not be fully expanded.
141 public llvm::FoldingSetNode {
142 const TemplateArgument *Arguments;
143 llvm::PointerIntPair<Decl *, 1, bool> AssociatedDeclAndFinal;
144
145public:
147 Decl *AssociatedDecl, unsigned Index,
148 bool Final);
149
150 /// A template-like entity which owns the whole pattern being substituted.
151 /// This will own a set of template parameters.
152 Decl *getAssociatedDecl() const;
153
154 /// Returns the index of the replaced parameter in the associated declaration.
155 /// This should match the result of `getParameterPack()->getIndex()`.
156 unsigned getIndex() const { return Bits.Index; }
157
158 // When true the substitution will be 'Final' (subst node won't be placed).
159 bool getFinal() const;
160
161 /// Retrieve the template template parameter pack being substituted.
162 TemplateTemplateParmDecl *getParameterPack() const;
163
164 /// Retrieve the template template argument pack with which this
165 /// parameter was substituted.
166 TemplateArgument getArgumentPack() const;
167
168 void Profile(llvm::FoldingSetNodeID &ID, ASTContext &Context);
169
170 static void Profile(llvm::FoldingSetNodeID &ID, ASTContext &Context,
171 const TemplateArgument &ArgPack, Decl *AssociatedDecl,
172 unsigned Index, bool Final);
173};
174
175/// Represents a C++ template name within the type system.
176///
177/// A C++ template name refers to a template within the C++ type
178/// system. In most cases, a template name is simply a reference to a
179/// class template, e.g.
180///
181/// \code
182/// template<typename T> class X { };
183///
184/// X<int> xi;
185/// \endcode
186///
187/// Here, the 'X' in \c X<int> is a template name that refers to the
188/// declaration of the class template X, above. Template names can
189/// also refer to function templates, C++0x template aliases, etc.
190///
191/// Some template names are dependent. For example, consider:
192///
193/// \code
194/// template<typename MetaFun, typename T1, typename T2> struct apply2 {
195/// typedef typename MetaFun::template apply<T1, T2>::type type;
196/// };
197/// \endcode
198///
199/// Here, "apply" is treated as a template name within the typename
200/// specifier in the typedef. "apply" is a nested template, and can
201/// only be understood in the context of a template instantiation,
202/// hence is represented as a dependent template name.
204 // NameDecl is either a TemplateDecl or a UsingShadowDecl depending on the
205 // NameKind.
206 // !! There is no free low bits in 32-bit builds to discriminate more than 4
207 // pointer types in PointerUnion.
208 using StorageType =
209 llvm::PointerUnion<Decl *, UncommonTemplateNameStorage *,
211
212 StorageType Storage;
213
214 explicit TemplateName(void *Ptr);
215
216public:
217 // Kind of name that is actually stored.
218 enum NameKind {
219 /// A single template declaration.
221
222 /// A set of overloaded template declarations.
224
225 /// An unqualified-id that has been assumed to name a function template
226 /// that will be found by ADL.
228
229 /// A qualified template name, where the qualification is kept
230 /// to describe the source code as written.
232
233 /// A dependent template name that has not been resolved to a
234 /// template (or set of templates).
236
237 /// A template template parameter that has been substituted
238 /// for some other template name.
240
241 /// A template template parameter pack that has been substituted for
242 /// a template template argument pack, but has not yet been expanded into
243 /// individual arguments.
245
246 /// A template name that refers to a template declaration found through a
247 /// specific using shadow declaration.
249 };
250
251 TemplateName() = default;
252 explicit TemplateName(TemplateDecl *Template);
253 explicit TemplateName(OverloadedTemplateStorage *Storage);
254 explicit TemplateName(AssumedTemplateStorage *Storage);
257 explicit TemplateName(QualifiedTemplateName *Qual);
258 explicit TemplateName(DependentTemplateName *Dep);
259 explicit TemplateName(UsingShadowDecl *Using);
260
261 /// Determine whether this template name is NULL.
262 bool isNull() const;
263
264 // Get the kind of name that is actually stored.
265 NameKind getKind() const;
266
267 /// Retrieve the underlying template declaration that
268 /// this template name refers to, if known.
269 ///
270 /// \returns The template declaration that this template name refers
271 /// to, if any. If the template name does not refer to a specific
272 /// declaration because it is a dependent name, or if it refers to a
273 /// set of function templates, returns NULL.
274 TemplateDecl *getAsTemplateDecl() const;
275
276 /// Retrieve the underlying, overloaded function template
277 /// declarations that this template name refers to, if known.
278 ///
279 /// \returns The set of overloaded function templates that this template
280 /// name refers to, if known. If the template name does not refer to a
281 /// specific set of function templates because it is a dependent name or
282 /// refers to a single template, returns NULL.
283 OverloadedTemplateStorage *getAsOverloadedTemplate() const;
284
285 /// Retrieve information on a name that has been assumed to be a
286 /// template-name in order to permit a call via ADL.
287 AssumedTemplateStorage *getAsAssumedTemplateName() const;
288
289 /// Retrieve the substituted template template parameter, if
290 /// known.
291 ///
292 /// \returns The storage for the substituted template template parameter,
293 /// if known. Otherwise, returns NULL.
294 SubstTemplateTemplateParmStorage *getAsSubstTemplateTemplateParm() const;
295
296 /// Retrieve the substituted template template parameter pack, if
297 /// known.
298 ///
299 /// \returns The storage for the substituted template template parameter pack,
300 /// if known. Otherwise, returns NULL.
302 getAsSubstTemplateTemplateParmPack() const;
303
304 /// Retrieve the underlying qualified template name
305 /// structure, if any.
306 QualifiedTemplateName *getAsQualifiedTemplateName() const;
307
308 /// Retrieve the underlying dependent template name
309 /// structure, if any.
310 DependentTemplateName *getAsDependentTemplateName() const;
311
312 /// Retrieve the using shadow declaration through which the underlying
313 /// template declaration is introduced, if any.
314 UsingShadowDecl *getAsUsingShadowDecl() const;
315
316 TemplateName getUnderlying() const;
317
318 TemplateNameDependence getDependence() const;
319
320 /// Determines whether this is a dependent template name.
321 bool isDependent() const;
322
323 /// Determines whether this is a template name that somehow
324 /// depends on a template parameter.
325 bool isInstantiationDependent() const;
326
327 /// Determines whether this template name contains an
328 /// unexpanded parameter pack (for C++0x variadic templates).
329 bool containsUnexpandedParameterPack() const;
330
331 enum class Qualified { None, AsWritten };
332 /// Print the template name.
333 ///
334 /// \param OS the output stream to which the template name will be
335 /// printed.
336 ///
337 /// \param Qual print the (Qualified::None) simple name,
338 /// (Qualified::AsWritten) any written (possibly partial) qualifier, or
339 /// (Qualified::Fully) the fully qualified name.
340 void print(raw_ostream &OS, const PrintingPolicy &Policy,
341 Qualified Qual = Qualified::AsWritten) const;
342
343 /// Debugging aid that dumps the template name.
344 void dump(raw_ostream &OS, const ASTContext &Context) const;
345
346 /// Debugging aid that dumps the template name to standard
347 /// error.
348 void dump() const;
349
350 void Profile(llvm::FoldingSetNodeID &ID) {
351 ID.AddPointer(Storage.getOpaqueValue());
352 }
353
354 /// Retrieve the template name as a void pointer.
355 void *getAsVoidPointer() const { return Storage.getOpaqueValue(); }
356
357 /// Build a template name from a void pointer.
359 return TemplateName(Ptr);
360 }
361
362 /// Structural equality.
363 bool operator==(TemplateName Other) const { return Storage == Other.Storage; }
364 bool operator!=(TemplateName Other) const { return !operator==(Other); }
365};
366
367/// Insertion operator for diagnostics. This allows sending TemplateName's
368/// into a diagnostic with <<.
369const StreamingDiagnostic &operator<<(const StreamingDiagnostic &DB,
370 TemplateName N);
371
372/// A structure for storing the information associated with a
373/// substituted template template parameter.
375 : public UncommonTemplateNameStorage, public llvm::FoldingSetNode {
376 friend class ASTContext;
377
378 TemplateName Replacement;
379 Decl *AssociatedDecl;
380
382 Decl *AssociatedDecl, unsigned Index,
383 std::optional<unsigned> PackIndex)
384 : UncommonTemplateNameStorage(SubstTemplateTemplateParm, Index,
385 PackIndex ? *PackIndex + 1 : 0),
386 Replacement(Replacement), AssociatedDecl(AssociatedDecl) {
387 assert(AssociatedDecl != nullptr);
388 }
389
390public:
391 /// A template-like entity which owns the whole pattern being substituted.
392 /// This will own a set of template parameters.
393 Decl *getAssociatedDecl() const { return AssociatedDecl; }
394
395 /// Returns the index of the replaced parameter in the associated declaration.
396 /// This should match the result of `getParameter()->getIndex()`.
397 unsigned getIndex() const { return Bits.Index; }
398
399 std::optional<unsigned> getPackIndex() const {
400 if (Bits.Data == 0)
401 return std::nullopt;
402 return Bits.Data - 1;
403 }
404
405 TemplateTemplateParmDecl *getParameter() const;
406 TemplateName getReplacement() const { return Replacement; }
407
408 void Profile(llvm::FoldingSetNodeID &ID);
409
410 static void Profile(llvm::FoldingSetNodeID &ID, TemplateName Replacement,
411 Decl *AssociatedDecl, unsigned Index,
412 std::optional<unsigned> PackIndex);
413};
414
418 return subst->getReplacement().getUnderlying();
419 return *this;
420}
421
422/// Represents a template name as written in source code.
423///
424/// This kind of template name may refer to a template name that was
425/// preceded by a nested name specifier, e.g., \c std::vector. Here,
426/// the nested name specifier is "std::" and the template name is the
427/// declaration for "vector". It may also have been written with the
428/// 'template' keyword. The QualifiedTemplateName class is only
429/// used to provide "sugar" for template names, so that they can
430/// be differentiated from canonical template names. and has no
431/// semantic meaning. In this manner, it is to TemplateName what
432/// ElaboratedType is to Type, providing extra syntactic sugar
433/// for downstream clients.
434class QualifiedTemplateName : public llvm::FoldingSetNode {
435 friend class ASTContext;
436
437 /// The nested name specifier that qualifies the template name.
438 ///
439 /// The bit is used to indicate whether the "template" keyword was
440 /// present before the template name itself. Note that the
441 /// "template" keyword is always redundant in this case (otherwise,
442 /// the template name would be a dependent name and we would express
443 /// this name with DependentTemplateName).
444 llvm::PointerIntPair<NestedNameSpecifier *, 1> Qualifier;
445
446 /// The underlying template name, it is either
447 /// 1) a Template -- a template declaration that this qualified name refers
448 /// to.
449 /// 2) or a UsingTemplate -- a template declaration introduced by a
450 /// using-shadow declaration.
451 TemplateName UnderlyingTemplate;
452
453 QualifiedTemplateName(NestedNameSpecifier *NNS, bool TemplateKeyword,
454 TemplateName Template)
455 : Qualifier(NNS, TemplateKeyword ? 1 : 0), UnderlyingTemplate(Template) {
456 assert(UnderlyingTemplate.getKind() == TemplateName::Template ||
457 UnderlyingTemplate.getKind() == TemplateName::UsingTemplate);
458 }
459
460public:
461 /// Return the nested name specifier that qualifies this name.
462 NestedNameSpecifier *getQualifier() const { return Qualifier.getPointer(); }
463
464 /// Whether the template name was prefixed by the "template"
465 /// keyword.
466 bool hasTemplateKeyword() const { return Qualifier.getInt(); }
467
468 /// Return the underlying template name.
469 TemplateName getUnderlyingTemplate() const { return UnderlyingTemplate; }
470
471 void Profile(llvm::FoldingSetNodeID &ID) {
472 Profile(ID, getQualifier(), hasTemplateKeyword(), UnderlyingTemplate);
473 }
474
475 static void Profile(llvm::FoldingSetNodeID &ID, NestedNameSpecifier *NNS,
476 bool TemplateKeyword, TemplateName TN) {
477 ID.AddPointer(NNS);
478 ID.AddBoolean(TemplateKeyword);
479 ID.AddPointer(TN.getAsVoidPointer());
480 }
481};
482
483/// Represents a dependent template name that cannot be
484/// resolved prior to template instantiation.
485///
486/// This kind of template name refers to a dependent template name,
487/// including its nested name specifier (if any). For example,
488/// DependentTemplateName can refer to "MetaFun::template apply",
489/// where "MetaFun::" is the nested name specifier and "apply" is the
490/// template name referenced. The "template" keyword is implied.
491class DependentTemplateName : public llvm::FoldingSetNode {
492 friend class ASTContext;
493
494 /// The nested name specifier that qualifies the template
495 /// name.
496 ///
497 /// The bit stored in this qualifier describes whether the \c Name field
498 /// is interpreted as an IdentifierInfo pointer (when clear) or as an
499 /// overloaded operator kind (when set).
500 llvm::PointerIntPair<NestedNameSpecifier *, 1, bool> Qualifier;
501
502 /// The dependent template name.
503 union {
504 /// The identifier template name.
505 ///
506 /// Only valid when the bit on \c Qualifier is clear.
508
509 /// The overloaded operator name.
510 ///
511 /// Only valid when the bit on \c Qualifier is set.
513 };
514
515 /// The canonical template name to which this dependent
516 /// template name refers.
517 ///
518 /// The canonical template name for a dependent template name is
519 /// another dependent template name whose nested name specifier is
520 /// canonical.
521 TemplateName CanonicalTemplateName;
522
525 : Qualifier(Qualifier, false), Identifier(Identifier),
526 CanonicalTemplateName(this) {}
527
528 DependentTemplateName(NestedNameSpecifier *Qualifier,
529 const IdentifierInfo *Identifier,
530 TemplateName Canon)
531 : Qualifier(Qualifier, false), Identifier(Identifier),
532 CanonicalTemplateName(Canon) {}
533
534 DependentTemplateName(NestedNameSpecifier *Qualifier,
535 OverloadedOperatorKind Operator)
536 : Qualifier(Qualifier, true), Operator(Operator),
537 CanonicalTemplateName(this) {}
538
539 DependentTemplateName(NestedNameSpecifier *Qualifier,
540 OverloadedOperatorKind Operator,
541 TemplateName Canon)
542 : Qualifier(Qualifier, true), Operator(Operator),
543 CanonicalTemplateName(Canon) {}
544
545public:
546 /// Return the nested name specifier that qualifies this name.
547 NestedNameSpecifier *getQualifier() const { return Qualifier.getPointer(); }
548
549 /// Determine whether this template name refers to an identifier.
550 bool isIdentifier() const { return !Qualifier.getInt(); }
551
552 /// Returns the identifier to which this template name refers.
554 assert(isIdentifier() && "Template name isn't an identifier?");
555 return Identifier;
556 }
557
558 /// Determine whether this template name refers to an overloaded
559 /// operator.
560 bool isOverloadedOperator() const { return Qualifier.getInt(); }
561
562 /// Return the overloaded operator to which this template name refers.
564 assert(isOverloadedOperator() &&
565 "Template name isn't an overloaded operator?");
566 return Operator;
567 }
568
569 void Profile(llvm::FoldingSetNodeID &ID) {
570 if (isIdentifier())
571 Profile(ID, getQualifier(), getIdentifier());
572 else
573 Profile(ID, getQualifier(), getOperator());
574 }
575
576 static void Profile(llvm::FoldingSetNodeID &ID, NestedNameSpecifier *NNS,
577 const IdentifierInfo *Identifier) {
578 ID.AddPointer(NNS);
579 ID.AddBoolean(false);
580 ID.AddPointer(Identifier);
581 }
582
583 static void Profile(llvm::FoldingSetNodeID &ID, NestedNameSpecifier *NNS,
584 OverloadedOperatorKind Operator) {
585 ID.AddPointer(NNS);
586 ID.AddBoolean(true);
587 ID.AddInteger(Operator);
588 }
589};
590
591} // namespace clang.
592
593namespace llvm {
594
595/// The clang::TemplateName class is effectively a pointer.
596template<>
597struct PointerLikeTypeTraits<clang::TemplateName> {
598 static inline void *getAsVoidPointer(clang::TemplateName TN) {
599 return TN.getAsVoidPointer();
600 }
601
602 static inline clang::TemplateName getFromVoidPointer(void *Ptr) {
604 }
605
606 // No bits are available!
607 static constexpr int NumLowBitsAvailable = 0;
608};
609
610} // namespace llvm.
611
612#endif // LLVM_CLANG_AST_TEMPLATENAME_H
static char ID
Definition: Arena.cpp:183
static llvm::GlobalValue::DLLStorageClassTypes getStorage(CodeGenModule &CGM, StringRef Name)
Definition: CGObjCMac.cpp:6438
static void dump(llvm::raw_ostream &OS, StringRef FunctionName, ArrayRef< CounterExpression > Expressions, ArrayRef< CounterMappingRegion > Regions)
static Decl::Kind getKind(const Decl *D)
Definition: DeclBase.cpp:1171
StringRef Identifier
Definition: Format.cpp:3009
static void print(llvm::raw_ostream &OS, const T &V, ASTContext &ASTCtx, QualType Ty)
Forward-declares and imports various common LLVM datatypes that clang wants to use unqualified.
static StringRef getIdentifier(const Token &Tok)
__device__ int
Holds long-lived AST nodes (such as types and decls) that can be referred to throughout the semantic ...
Definition: ASTContext.h:187
A structure for storing the information associated with a name that has been assumed to be a template...
Decl - This represents one declaration (or definition), e.g.
Definition: DeclBase.h:86
Represents a dependent template name that cannot be resolved prior to template instantiation.
Definition: TemplateName.h:491
OverloadedOperatorKind Operator
The overloaded operator name.
Definition: TemplateName.h:512
OverloadedOperatorKind getOperator() const
Return the overloaded operator to which this template name refers.
Definition: TemplateName.h:563
bool isIdentifier() const
Determine whether this template name refers to an identifier.
Definition: TemplateName.h:550
static void Profile(llvm::FoldingSetNodeID &ID, NestedNameSpecifier *NNS, OverloadedOperatorKind Operator)
Definition: TemplateName.h:583
NestedNameSpecifier * getQualifier() const
Return the nested name specifier that qualifies this name.
Definition: TemplateName.h:547
static void Profile(llvm::FoldingSetNodeID &ID, NestedNameSpecifier *NNS, const IdentifierInfo *Identifier)
Definition: TemplateName.h:576
const IdentifierInfo * getIdentifier() const
Returns the identifier to which this template name refers.
Definition: TemplateName.h:553
const IdentifierInfo * Identifier
The identifier template name.
Definition: TemplateName.h:507
void Profile(llvm::FoldingSetNodeID &ID)
Definition: TemplateName.h:569
bool isOverloadedOperator() const
Determine whether this template name refers to an overloaded operator.
Definition: TemplateName.h:560
One of these records is kept for each identifier that is lexed.
This represents a decl that may have a name.
Definition: Decl.h:249
Represents a C++ nested name specifier, such as "\::std::vector<int>::".
A structure for storing the information associated with an overloaded template name.
Definition: TemplateName.h:108
llvm::ArrayRef< NamedDecl * > decls() const
Definition: TemplateName.h:129
Represents a template name as written in source code.
Definition: TemplateName.h:434
static void Profile(llvm::FoldingSetNodeID &ID, NestedNameSpecifier *NNS, bool TemplateKeyword, TemplateName TN)
Definition: TemplateName.h:475
void Profile(llvm::FoldingSetNodeID &ID)
Definition: TemplateName.h:471
TemplateName getUnderlyingTemplate() const
Return the underlying template name.
Definition: TemplateName.h:469
NestedNameSpecifier * getQualifier() const
Return the nested name specifier that qualifies this name.
Definition: TemplateName.h:462
bool hasTemplateKeyword() const
Whether the template name was prefixed by the "template" keyword.
Definition: TemplateName.h:466
A structure for storing an already-substituted template template parameter pack.
Definition: TemplateName.h:141
unsigned getIndex() const
Returns the index of the replaced parameter in the associated declaration.
Definition: TemplateName.h:156
A structure for storing the information associated with a substituted template template parameter.
Definition: TemplateName.h:375
std::optional< unsigned > getPackIndex() const
Definition: TemplateName.h:399
unsigned getIndex() const
Returns the index of the replaced parameter in the associated declaration.
Definition: TemplateName.h:397
Decl * getAssociatedDecl() const
A template-like entity which owns the whole pattern being substituted.
Definition: TemplateName.h:393
Represents a template argument.
Definition: TemplateBase.h:61
The base class of all kinds of template declarations (e.g., class, function, etc.).
Definition: DeclTemplate.h:394
Represents a C++ template name within the type system.
Definition: TemplateName.h:203
TemplateName()=default
bool operator==(TemplateName Other) const
Structural equality.
Definition: TemplateName.h:363
static TemplateName getFromVoidPointer(void *Ptr)
Build a template name from a void pointer.
Definition: TemplateName.h:358
bool operator!=(TemplateName Other) const
Definition: TemplateName.h:364
NameKind getKind() const
void * getAsVoidPointer() const
Retrieve the template name as a void pointer.
Definition: TemplateName.h:355
@ UsingTemplate
A template name that refers to a template declaration found through a specific using shadow declarati...
Definition: TemplateName.h:248
@ OverloadedTemplate
A set of overloaded template declarations.
Definition: TemplateName.h:223
@ Template
A single template declaration.
Definition: TemplateName.h:220
@ DependentTemplate
A dependent template name that has not been resolved to a template (or set of templates).
Definition: TemplateName.h:235
@ SubstTemplateTemplateParm
A template template parameter that has been substituted for some other template name.
Definition: TemplateName.h:239
@ SubstTemplateTemplateParmPack
A template template parameter pack that has been substituted for a template template argument pack,...
Definition: TemplateName.h:244
@ QualifiedTemplate
A qualified template name, where the qualification is kept to describe the source code as written.
Definition: TemplateName.h:231
@ AssumedTemplate
An unqualified-id that has been assumed to name a function template that will be found by ADL.
Definition: TemplateName.h:227
void Profile(llvm::FoldingSetNodeID &ID)
Definition: TemplateName.h:350
TemplateName getUnderlying() const
Definition: TemplateName.h:415
void dump(raw_ostream &OS, const ASTContext &Context) const
Debugging aid that dumps the template name.
TemplateTemplateParmDecl - Declares a template template parameter, e.g., "T" in.
Implementation class used to describe either a set of overloaded template names or an already-substit...
Definition: TemplateName.h:48
SubstTemplateTemplateParmPackStorage * getAsSubstTemplateTemplateParmPack()
Definition: TemplateName.h:99
UncommonTemplateNameStorage(Kind Kind, unsigned Index, unsigned Data)
Definition: TemplateName.h:74
SubstTemplateTemplateParmStorage * getAsSubstTemplateTemplateParm()
Definition: TemplateName.h:93
AssumedTemplateStorage * getAsAssumedTemplateName()
Definition: TemplateName.h:87
OverloadedTemplateStorage * getAsOverloadedStorage()
Definition: TemplateName.h:81
Represents a shadow declaration implicitly introduced into a scope by a (resolved) using-declaration ...
Definition: DeclCXX.h:3324
@ Decl
The l-value was an access to a declared entity or something equivalently strong, like the address of ...
The JSON file list parser is used to communicate input to InstallAPI.
OverloadedOperatorKind
Enumeration specifying the different kinds of C++ overloaded operators.
Definition: OperatorKinds.h:21
bool operator==(const CallGraphNode::CallRecord &LHS, const CallGraphNode::CallRecord &RHS)
Definition: CallGraph.h:207
const StreamingDiagnostic & operator<<(const StreamingDiagnostic &DB, const ASTContext::SectionInfo &Section)
Insertion operator for diagnostics.
@ Other
Other implicit parameter.
Diagnostic wrappers for TextAPI types for error reporting.
Definition: Dominators.h:30
#define true
Definition: stdbool.h:25
#define false
Definition: stdbool.h:26
Describes how types, statements, expressions, and declarations should be printed.
Definition: PrettyPrinter.h:57
unsigned Data
The pack index, or the number of stored templates or template arguments, depending on which subclass ...
Definition: TemplateName.h:66
static void * getAsVoidPointer(clang::TemplateName TN)
Definition: TemplateName.h:598
static clang::TemplateName getFromVoidPointer(void *Ptr)
Definition: TemplateName.h:602