clang 22.0.0git
TemplateName.cpp
Go to the documentation of this file.
1//===- TemplateName.cpp - C++ Template Name Representation ----------------===//
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
14#include "clang/AST/Decl.h"
15#include "clang/AST/DeclBase.h"
16#include "clang/AST/DeclCXX.h"
23#include "clang/Basic/LLVM.h"
26#include "llvm/ADT/ArrayRef.h"
27#include "llvm/ADT/FoldingSet.h"
28#include "llvm/Support/Compiler.h"
29#include "llvm/Support/raw_ostream.h"
30#include <cassert>
31#include <optional>
32#include <string>
33
34using namespace clang;
35
36DeducedTemplateStorage::DeducedTemplateStorage(TemplateName Underlying,
37 const DefaultArguments &DefArgs)
38 : UncommonTemplateNameStorage(Deduced, /*Index=*/DefArgs.StartPos,
39 DefArgs.Args.size()),
40 Underlying(Underlying) {
41 llvm::copy(DefArgs.Args, reinterpret_cast<TemplateArgument *>(this + 1));
42}
43
44void DeducedTemplateStorage::Profile(llvm::FoldingSetNodeID &ID,
45 const ASTContext &Context) const {
46 Profile(ID, Context, Underlying, getDefaultArguments());
47}
48
49void DeducedTemplateStorage::Profile(llvm::FoldingSetNodeID &ID,
50 const ASTContext &Context,
51 TemplateName Underlying,
52 const DefaultArguments &DefArgs) {
53 Underlying.Profile(ID);
54 ID.AddInteger(DefArgs.StartPos);
55 ID.AddInteger(DefArgs.Args.size());
56 for (const TemplateArgument &Arg : DefArgs.Args)
57 Arg.Profile(ID, Context);
58}
59
62 return TemplateArgument(ArrayRef(Arguments, Bits.Data));
63}
64
67 return cast<TemplateTemplateParmDecl>(
69 ->asArray()[Bits.Index]);
70}
71
74 return cast<TemplateTemplateParmDecl>(
76 ->asArray()[Bits.Index]);
77}
78
79void SubstTemplateTemplateParmStorage::Profile(llvm::FoldingSetNodeID &ID) {
80 Profile(ID, Replacement, getAssociatedDecl(), getIndex(), getPackIndex(),
81 getFinal());
82}
83
85 llvm::FoldingSetNodeID &ID, TemplateName Replacement, Decl *AssociatedDecl,
86 unsigned Index, UnsignedOrNone PackIndex, bool Final) {
87 Replacement.Profile(ID);
88 ID.AddPointer(AssociatedDecl);
89 ID.AddInteger(Index);
90 ID.AddInteger(PackIndex.toInternalRepresentation());
91 ID.AddBoolean(Final);
92}
93
95 ArrayRef<TemplateArgument> ArgPack, Decl *AssociatedDecl, unsigned Index,
96 bool Final)
97 : UncommonTemplateNameStorage(SubstTemplateTemplateParmPack, Index,
98 ArgPack.size()),
99 Arguments(ArgPack.data()), AssociatedDeclAndFinal(AssociatedDecl, Final) {
100 assert(AssociatedDecl != nullptr);
101}
102
103void SubstTemplateTemplateParmPackStorage::Profile(llvm::FoldingSetNodeID &ID,
104 ASTContext &Context) {
106 getFinal());
107}
108
110 return AssociatedDeclAndFinal.getPointer();
111}
112
114 return AssociatedDeclAndFinal.getInt();
115}
116
118 llvm::FoldingSetNodeID &ID, ASTContext &Context,
119 const TemplateArgument &ArgPack, Decl *AssociatedDecl, unsigned Index,
120 bool Final) {
121 ArgPack.Profile(ID, Context);
122 ID.AddPointer(AssociatedDecl);
123 ID.AddInteger(Index);
124 ID.AddBoolean(Final);
125}
126
128 const IdentifierInfo *II)
129 : PtrOrOp(reinterpret_cast<uintptr_t>(II)) {
130 static_assert(NUM_OVERLOADED_OPERATORS <= 4096,
131 "NUM_OVERLOADED_OPERATORS is too large");
132 assert(II);
133 assert(getIdentifier() == II);
134}
137 : PtrOrOp(-uintptr_t(OOK)) {
138 assert(OOK != OO_None);
139 assert(getOperator() == OOK);
140}
141
142void IdentifierOrOverloadedOperator::Profile(llvm::FoldingSetNodeID &ID) const {
143 if (auto *Identifier = getIdentifier()) {
144 ID.AddBoolean(false);
145 ID.AddPointer(Identifier);
146 } else {
147 ID.AddBoolean(true);
148 ID.AddInteger(getOperator());
149 }
150}
151
153 Storage = StorageType::getFromOpaqueValue(Ptr);
154}
155
158 : Storage(Storage) {}
160 : Storage(Storage) {}
162 : Storage(Storage) {}
164 : Storage(Storage) {}
169 : Storage(Deduced) {}
170
171bool TemplateName::isNull() const { return Storage.isNull(); }
172
174 if (auto *ND = dyn_cast<Decl *>(Storage)) {
175 if (isa<UsingShadowDecl>(ND))
176 return UsingTemplate;
177 assert(isa<TemplateDecl>(ND));
178 return Template;
179 }
180
181 if (isa<DependentTemplateName *>(Storage))
182 return DependentTemplate;
183 if (isa<QualifiedTemplateName *>(Storage))
184 return QualifiedTemplate;
185
187 cast<UncommonTemplateNameStorage *>(Storage);
188 if (uncommon->getAsOverloadedStorage())
189 return OverloadedTemplate;
190 if (uncommon->getAsAssumedTemplateName())
191 return AssumedTemplate;
192 if (uncommon->getAsSubstTemplateTemplateParm())
194 if (uncommon->getAsDeducedTemplateName())
195 return DeducedTemplate;
196
197 assert(uncommon->getAsSubstTemplateTemplateParmPack() != nullptr);
199}
200
202 TemplateName Name = *this;
203 while (std::optional<TemplateName> UnderlyingOrNone =
204 Name.desugar(IgnoreDeduced))
205 Name = *UnderlyingOrNone;
206
207 if (!IgnoreDeduced)
208 assert(Name.getAsDeducedTemplateName() == nullptr &&
209 "Unexpected canonical DeducedTemplateName; Did you mean to use "
210 "getTemplateDeclAndDefaultArgs instead?");
211
212 return cast_if_present<TemplateDecl>(
213 dyn_cast_if_present<Decl *>(Name.Storage));
214}
215
216std::pair<TemplateDecl *, DefaultArguments>
218 for (TemplateName Name = *this; /**/; /**/) {
219 if (Name.getKind() == TemplateName::DeducedTemplate) {
220 DeducedTemplateStorage *DTS = Name.getAsDeducedTemplateName();
221 TemplateDecl *TD =
222 DTS->getUnderlying().getAsTemplateDecl(/*IgnoreDeduced=*/true);
223 DefaultArguments DefArgs = DTS->getDefaultArguments();
224 if (TD && DefArgs)
225 assert(DefArgs.StartPos + DefArgs.Args.size() <=
226 TD->getTemplateParameters()->size());
227 return {TD, DTS->getDefaultArguments()};
228 }
229 if (std::optional<TemplateName> UnderlyingOrNone =
230 Name.desugar(/*IgnoreDeduced=*/false)) {
231 Name = *UnderlyingOrNone;
232 continue;
233 }
234 return {cast_if_present<TemplateDecl>(Name.Storage.dyn_cast<Decl *>()), {}};
235 }
236}
237
238std::optional<TemplateName> TemplateName::desugar(bool IgnoreDeduced) const {
239 if (Decl *D = dyn_cast_if_present<Decl *>(Storage)) {
240 if (auto *USD = dyn_cast<UsingShadowDecl>(D))
241 return TemplateName(USD->getTargetDecl());
242 return std::nullopt;
243 }
245 return QTN->getUnderlyingTemplate();
247 return S->getReplacement();
248 if (IgnoreDeduced)
250 return S->getUnderlying();
251 return std::nullopt;
252}
253
255 if (UncommonTemplateNameStorage *Uncommon =
256 Storage.dyn_cast<UncommonTemplateNameStorage *>())
257 return Uncommon->getAsOverloadedStorage();
258
259 return nullptr;
260}
261
263 if (UncommonTemplateNameStorage *Uncommon =
264 Storage.dyn_cast<UncommonTemplateNameStorage *>())
265 return Uncommon->getAsAssumedTemplateName();
266
267 return nullptr;
268}
269
272 if (UncommonTemplateNameStorage *uncommon =
273 dyn_cast_if_present<UncommonTemplateNameStorage *>(Storage))
274 return uncommon->getAsSubstTemplateTemplateParm();
275
276 return nullptr;
277}
278
281 if (UncommonTemplateNameStorage *Uncommon =
282 Storage.dyn_cast<UncommonTemplateNameStorage *>())
283 return Uncommon->getAsSubstTemplateTemplateParmPack();
284
285 return nullptr;
286}
287
289 return dyn_cast_if_present<QualifiedTemplateName *>(Storage);
290}
291
293 return Storage.dyn_cast<DependentTemplateName *>();
294}
295
296std::tuple<NestedNameSpecifier, bool>
298 for (std::optional<TemplateName> Cur = *this; Cur;
299 Cur = Cur->desugar(/*IgnoreDeduced=*/true)) {
300 if (DependentTemplateName *N = Cur->getAsDependentTemplateName())
301 return {N->getQualifier(), N->hasTemplateKeyword()};
302 if (QualifiedTemplateName *N = Cur->getAsQualifiedTemplateName())
303 return {N->getQualifier(), N->hasTemplateKeyword()};
304 if (Cur->getAsSubstTemplateTemplateParm() ||
305 Cur->getAsSubstTemplateTemplateParmPack())
306 break;
307 }
308 return {std::nullopt, false};
309}
310
312 if (Decl *D = Storage.dyn_cast<Decl *>())
313 if (UsingShadowDecl *USD = dyn_cast<UsingShadowDecl>(D))
314 return USD;
316 return QTN->getUnderlyingTemplate().getAsUsingShadowDecl();
317 return nullptr;
318}
319
322 bool HasTemplateKeyword)
323 : Qualifier(Qualifier, HasTemplateKeyword), Name(Name) {
324 assert((!Qualifier || Qualifier.isDependent()) &&
325 "Qualifier must be dependent");
326}
327
328TemplateNameDependence DependentTemplateStorage::getDependence() const {
330 TemplateNameDependence::DependentInstantiation;
331}
332
334 const PrintingPolicy &Policy) const {
335 getQualifier().print(OS, Policy);
336
337 if (hasTemplateKeyword())
338 OS << "template ";
339
341 if (const IdentifierInfo *II = Name.getIdentifier())
342 OS << II->getName();
343 else
344 OS << "operator " << getOperatorSpelling(Name.getOperator());
345}
346
348 if (UncommonTemplateNameStorage *Uncommon =
349 dyn_cast_if_present<UncommonTemplateNameStorage *>(Storage))
350 return Uncommon->getAsDeducedTemplateName();
351
352 return nullptr;
353}
354
355TemplateNameDependence TemplateName::getDependence() const {
356 switch (getKind()) {
360 auto D = TemplateNameDependence::None;
361 if (auto *TTP = dyn_cast<TemplateTemplateParmDecl>(Template)) {
362 D |= TemplateNameDependence::DependentInstantiation;
363 if (TTP->isParameterPack())
364 D |= TemplateNameDependence::UnexpandedPack;
365 }
366 // FIXME: Hack, getDeclContext() can be null if Template is still
367 // initializing due to PCH reading, so we check it before using it.
368 // Should probably modify TemplateSpecializationType to allow constructing
369 // it without the isDependent() checking.
370 if (Template->getDeclContext() &&
371 Template->getDeclContext()->isDependentContext())
372 D |= TemplateNameDependence::DependentInstantiation;
373 return D;
374 }
377 TemplateNameDependence D = S->getUnderlyingTemplate().getDependence();
378 D |= toTemplateNameDependence(S->getQualifier().getDependence());
379 return D;
380 }
383 return toTemplateNameDependence(S->getQualifier().getDependence()) |
384 TemplateNameDependence::DependentInstantiation;
385 }
388 return S->getReplacement().getDependence();
389 }
391 return TemplateNameDependence::UnexpandedPack |
392 TemplateNameDependence::DependentInstantiation;
395 TemplateNameDependence D = DTS->getUnderlying().getDependence();
396 for (const TemplateArgument &Arg : DTS->getDefaultArguments().Args)
397 D |= toTemplateNameDependence(Arg.getDependence());
398 return D;
399 }
401 return TemplateNameDependence::DependentInstantiation;
403 llvm_unreachable("overloaded templates shouldn't survive to here.");
404 }
405 llvm_unreachable("Unknown TemplateName kind");
406}
407
409 return getDependence() & TemplateNameDependence::Dependent;
410}
411
413 return getDependence() & TemplateNameDependence::Instantiation;
414}
415
417 return getDependence() & TemplateNameDependence::UnexpandedPack;
418}
419
420void TemplateName::print(raw_ostream &OS, const PrintingPolicy &Policy,
421 Qualified Qual) const {
422 auto handleAnonymousTTP = [&](TemplateDecl *TD, raw_ostream &OS) {
423 if (TemplateTemplateParmDecl *TTP = dyn_cast<TemplateTemplateParmDecl>(TD);
424 TTP && (Policy.PrintAsCanonical || TTP->getIdentifier() == nullptr)) {
425 OS << "template-parameter-" << TTP->getDepth() << "-" << TTP->getIndex();
426 return true;
427 }
428 return false;
429 };
430 if (NameKind Kind = getKind();
432 // After `namespace ns { using std::vector }`, what is the fully-qualified
433 // name of the UsingTemplateName `vector` within ns?
434 //
435 // - ns::vector (the qualified name of the using-shadow decl)
436 // - std::vector (the qualified name of the underlying template decl)
437 //
438 // Similar to the UsingType behavior, using declarations are used to import
439 // names more often than to export them, thus using the original name is
440 // most useful in this case.
442 if (Policy.PrintAsCanonical)
443 Template = cast<TemplateDecl>(Template->getCanonicalDecl());
444 if (handleAnonymousTTP(Template, OS))
445 return;
446 if (Qual == Qualified::None || isa<TemplateTemplateParmDecl>(Template) ||
447 Policy.SuppressScope) {
448 if (IdentifierInfo *II = Template->getIdentifier();
449 Policy.CleanUglifiedParameters && II &&
450 isa<TemplateTemplateParmDecl>(Template))
451 OS << II->deuglifiedName();
452 else
453 OS << *Template;
454 } else {
455 PrintingPolicy NestedNamePolicy = Policy;
456 NestedNamePolicy.SuppressUnwrittenScope = true;
457 Template->printQualifiedName(OS, NestedNamePolicy);
458 }
460 if (Policy.PrintAsCanonical) {
461 QTN->getUnderlyingTemplate().print(OS, Policy, Qual);
462 return;
463 }
464 if (Qual != Qualified::None)
465 QTN->getQualifier().print(OS, Policy);
466 if (QTN->hasTemplateKeyword())
467 OS << "template ";
468
469 TemplateName Underlying = QTN->getUnderlyingTemplate();
470 assert(Underlying.getKind() == TemplateName::Template ||
471 Underlying.getKind() == TemplateName::UsingTemplate);
472
473 TemplateDecl *UTD = Underlying.getAsTemplateDecl();
474
475 if (handleAnonymousTTP(UTD, OS))
476 return;
477
478 OS << *UTD;
480 DTN->print(OS, Policy);
481 } else if (SubstTemplateTemplateParmStorage *subst =
483 subst->getReplacement().print(OS, Policy, Qual);
484 } else if (SubstTemplateTemplateParmPackStorage *SubstPack =
486 OS << *SubstPack->getParameterPack();
487 else if (AssumedTemplateStorage *Assumed = getAsAssumedTemplateName()) {
488 Assumed->getDeclName().print(OS, Policy);
489 } else if (DeducedTemplateStorage *Deduced = getAsDeducedTemplateName()) {
490 Deduced->getUnderlying().print(OS, Policy);
491 DefaultArguments DefArgs = Deduced->getDefaultArguments();
492 OS << ":" << DefArgs.StartPos;
493 printTemplateArgumentList(OS, DefArgs.Args, Policy);
494 } else {
497 (*OTS->begin())->printName(OS, Policy);
498 }
499}
500
502 TemplateName N) {
503 std::string NameStr;
504 llvm::raw_string_ostream OS(NameStr);
505 LangOptions LO;
506 LO.CPlusPlus = true;
507 LO.Bool = true;
508 OS << '\'';
509 N.print(OS, PrintingPolicy(LO));
510 OS << '\'';
511 return DB << NameStr;
512}
Defines the Diagnostic-related interfaces.
const Decl * D
Defines the C++ Decl subclasses, other than those for templates (found in DeclTemplate....
Defines the C++ template declaration subclasses.
StringRef Identifier
Definition: Format.cpp:3185
Forward-declares and imports various common LLVM datatypes that clang wants to use unqualified.
Defines the clang::LangOptions interface.
Defines an enumeration for C++ overloaded operators.
Holds long-lived AST nodes (such as types and decls) that can be referred to throughout the semantic ...
Definition: ASTContext.h:188
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
void print(raw_ostream &Out, unsigned Indentation=0, bool PrintInstantiation=false) const
TemplateName getUnderlying() const
Definition: TemplateName.h:471
void Profile(llvm::FoldingSetNodeID &ID, const ASTContext &Context) const
DefaultArguments getDefaultArguments() const
Definition: TemplateName.h:473
void print(raw_ostream &OS, const PrintingPolicy &Policy) const
IdentifierOrOverloadedOperator getName() const
Definition: TemplateName.h:609
NestedNameSpecifier getQualifier() const
Return the nested name specifier that qualifies this name.
Definition: TemplateName.h:607
DependentTemplateStorage(NestedNameSpecifier Qualifier, IdentifierOrOverloadedOperator Name, bool HasTemplateKeyword)
TemplateNameDependence getDependence() const
bool hasTemplateKeyword() const
Was this template name was preceeded by the template keyword?
Definition: TemplateName.h:612
One of these records is kept for each identifier that is lexed.
Keeps track of the various options that can be enabled, which controls the dialect of C or C++ that i...
Definition: LangOptions.h:434
Represents a C++ nested name specifier, such as "\::std::vector<int>::".
void print(raw_ostream &OS, const PrintingPolicy &Policy, bool ResolveTemplateArguments=false, bool PrintFinalScopeResOp=true) const
Print this nested name specifier to the given output stream.
A structure for storing the information associated with an overloaded template name.
Definition: TemplateName.h:118
Represents a template name as written in source code.
Definition: TemplateName.h:504
The streaming interface shared between DiagnosticBuilder and PartialDiagnostic.
Definition: Diagnostic.h:1115
A structure for storing an already-substituted template template parameter pack.
Definition: TemplateName.h:151
Decl * getAssociatedDecl() const
A template-like entity which owns the whole pattern being substituted.
void Profile(llvm::FoldingSetNodeID &ID, ASTContext &Context)
TemplateTemplateParmDecl * getParameterPack() const
Retrieve the template template parameter pack being substituted.
TemplateArgument getArgumentPack() const
Retrieve the template template argument pack with which this parameter was substituted.
unsigned getIndex() const
Returns the index of the replaced parameter in the associated declaration.
Definition: TemplateName.h:166
SubstTemplateTemplateParmPackStorage(ArrayRef< TemplateArgument > ArgPack, Decl *AssociatedDecl, unsigned Index, bool Final)
A structure for storing the information associated with a substituted template template parameter.
Definition: TemplateName.h:418
void Profile(llvm::FoldingSetNodeID &ID)
TemplateTemplateParmDecl * getParameter() const
unsigned getIndex() const
Returns the index of the replaced parameter in the associated declaration.
Definition: TemplateName.h:441
Decl * getAssociatedDecl() const
A template-like entity which owns the whole pattern being substituted.
Definition: TemplateName.h:437
Represents a template argument.
Definition: TemplateBase.h:61
void Profile(llvm::FoldingSetNodeID &ID, const ASTContext &Context) const
Used to insert TemplateArguments into FoldingSets.
The base class of all kinds of template declarations (e.g., class, function, etc.).
Definition: DeclTemplate.h:396
TemplateParameterList * getTemplateParameters() const
Get the list of template parameters.
Definition: DeclTemplate.h:415
Represents a C++ template name within the type system.
Definition: TemplateName.h:222
TemplateNameDependence getDependence() const
TemplateDecl * getAsTemplateDecl(bool IgnoreDeduced=false) const
Retrieve the underlying template declaration that this template name refers to, if known.
DeducedTemplateStorage * getAsDeducedTemplateName() const
Retrieve the deduced template info, if any.
bool isNull() const
Determine whether this template name is NULL.
TemplateName()=default
DependentTemplateName * getAsDependentTemplateName() const
Retrieve the underlying dependent template name structure, if any.
QualifiedTemplateName * getAsQualifiedTemplateName() const
Retrieve the underlying qualified template name structure, if any.
std::optional< TemplateName > desugar(bool IgnoreDeduced) const
void print(raw_ostream &OS, const PrintingPolicy &Policy, Qualified Qual=Qualified::AsWritten) const
Print the template name.
OverloadedTemplateStorage * getAsOverloadedTemplate() const
Retrieve the underlying, overloaded function template declarations that this template name refers to,...
bool containsUnexpandedParameterPack() const
Determines whether this template name contains an unexpanded parameter pack (for C++0x variadic templ...
AssumedTemplateStorage * getAsAssumedTemplateName() const
Retrieve information on a name that has been assumed to be a template-name in order to permit a call ...
NameKind getKind() const
@ UsingTemplate
A template name that refers to a template declaration found through a specific using shadow declarati...
Definition: TemplateName.h:267
@ OverloadedTemplate
A set of overloaded template declarations.
Definition: TemplateName.h:242
@ Template
A single template declaration.
Definition: TemplateName.h:239
@ DependentTemplate
A dependent template name that has not been resolved to a template (or set of templates).
Definition: TemplateName.h:254
@ SubstTemplateTemplateParm
A template template parameter that has been substituted for some other template name.
Definition: TemplateName.h:258
@ SubstTemplateTemplateParmPack
A template template parameter pack that has been substituted for a template template argument pack,...
Definition: TemplateName.h:263
@ DeducedTemplate
A template name that refers to another TemplateName with deduced default arguments.
Definition: TemplateName.h:271
@ QualifiedTemplate
A qualified template name, where the qualification is kept to describe the source code as written.
Definition: TemplateName.h:250
@ AssumedTemplate
An unqualified-id that has been assumed to name a function template that will be found by ADL.
Definition: TemplateName.h:246
UsingShadowDecl * getAsUsingShadowDecl() const
Retrieve the using shadow declaration through which the underlying template declaration is introduced...
SubstTemplateTemplateParmPackStorage * getAsSubstTemplateTemplateParmPack() const
Retrieve the substituted template template parameter pack, if known.
void Profile(llvm::FoldingSetNodeID &ID)
Definition: TemplateName.h:393
bool isDependent() const
Determines whether this is a dependent template name.
std::pair< TemplateDecl *, DefaultArguments > getTemplateDeclAndDefaultArgs() const
Retrieves the underlying template declaration that this template name refers to, along with the deduc...
SubstTemplateTemplateParmStorage * getAsSubstTemplateTemplateParm() const
Retrieve the substituted template template parameter, if known.
bool isInstantiationDependent() const
Determines whether this is a template name that somehow depends on a template parameter.
std::tuple< NestedNameSpecifier, bool > getQualifierAndTemplateKeyword() const
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:51
SubstTemplateTemplateParmPackStorage * getAsSubstTemplateTemplateParmPack()
Definition: TemplateName.h:109
SubstTemplateTemplateParmStorage * getAsSubstTemplateTemplateParm()
Definition: TemplateName.h:103
AssumedTemplateStorage * getAsAssumedTemplateName()
Definition: TemplateName.h:91
DeducedTemplateStorage * getAsDeducedTemplateName()
Definition: TemplateName.h:97
OverloadedTemplateStorage * getAsOverloadedStorage()
Definition: TemplateName.h:85
Represents a shadow declaration implicitly introduced into a scope by a (resolved) using-declaration ...
Definition: DeclCXX.h:3393
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
@ OO_None
Not an overloaded operator.
Definition: OperatorKinds.h:22
@ NUM_OVERLOADED_OPERATORS
Definition: OperatorKinds.h:26
TemplateNameDependence toTemplateNameDependence(NestedNameSpecifierDependence D)
const StreamingDiagnostic & operator<<(const StreamingDiagnostic &DB, const ASTContext::SectionInfo &Section)
Insertion operator for diagnostics.
@ Template
We are parsing a template declaration.
TemplateParameterList * getReplacedTemplateParameterList(const Decl *D)
Internal helper used by Subst* nodes to retrieve the parameter list for their AssociatedDecl.
void printTemplateArgumentList(raw_ostream &OS, ArrayRef< TemplateArgument > Args, const PrintingPolicy &Policy, const TemplateParameterList *TPL=nullptr)
Print a template argument list, including the '<' and '>' enclosing the template arguments.
const char * getOperatorSpelling(OverloadedOperatorKind Operator)
Retrieve the spelling of the given overloaded operator, without the preceding "operator" keyword.
__UINTPTR_TYPE__ uintptr_t
An unsigned integer type with the property that any valid pointer to void can be converted to this ty...
ArrayRef< TemplateArgument > Args
Definition: TemplateName.h:189
const IdentifierInfo * getIdentifier() const
Returns the identifier to which this template name refers.
Definition: TemplateName.h:559
void Profile(llvm::FoldingSetNodeID &ID) const
OverloadedOperatorKind getOperator() const
Return the overloaded operator to which this template name refers.
Definition: TemplateName.h:566
Describes how types, statements, expressions, and declarations should be printed.
Definition: PrettyPrinter.h:57
unsigned SuppressUnwrittenScope
Suppress printing parts of scope specifiers that are never written, e.g., for anonymous namespaces.
unsigned CleanUglifiedParameters
Whether to strip underscores when printing reserved parameter names.
unsigned SuppressScope
Suppresses printing of scope specifiers.
unsigned PrintAsCanonical
Whether to print entities as written or canonically.
unsigned Data
The pack index, or the number of stored templates or template arguments, depending on which subclass ...
Definition: TemplateName.h:70
constexpr unsigned toInternalRepresentation() const