clang 24.0.0git
NestedNameSpecifierBase.h
Go to the documentation of this file.
1//===- NestedNameSpecifier.h - C++ nested name specifiers -------*- 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 NestedNameSpecifier class, which represents
10// a C++ nested-name-specifier.
11//
12//===----------------------------------------------------------------------===//
13
14#ifndef LLVM_CLANG_AST_NESTEDNAMESPECIFIERBASE_H
15#define LLVM_CLANG_AST_NESTEDNAMESPECIFIERBASE_H
16
20#include "llvm/ADT/FoldingSet.h"
21#include "llvm/Support/Compiler.h"
22#include "llvm/Support/PointerLikeTypeTraits.h"
23#include <cstdint>
24#include <cstdlib>
25#include <utility>
26
27namespace clang {
28
29class ASTContext;
30class CXXRecordDecl;
31class NamedDecl;
32class IdentifierInfo;
33class LangOptions;
35struct PrintingPolicy;
36class Type;
37class TypeLoc;
38
40struct alignas(8) NamespaceAndPrefixStorage;
41
42/// Represents a C++ nested name specifier, such as
43/// "\::std::vector<int>::".
44///
45/// C++ nested name specifiers are the prefixes to qualified
46/// names. For example, "foo::" in "foo::x" is a nested name
47/// specifier. Nested name specifiers are made up of a sequence of
48/// specifiers, each of which can be a namespace, type, decltype specifier, or
49/// the global specifier ('::'). The last two specifiers can only appear at the
50/// start of a nested-namespace-specifier.
51class NestedNameSpecifier {
52 enum class FlagKind { Null, Global };
53 enum class StoredKind {
54 Type,
55 NamespaceOrSuper,
56 NamespaceWithGlobal,
57 NamespaceWithNamespace
58 };
59 static constexpr uintptr_t FlagBits = 2, FlagMask = (1u << FlagBits) - 1u,
60 FlagOffset = 1, PtrOffset = FlagBits + FlagOffset,
61 PtrMask = (1u << PtrOffset) - 1u;
62
63 uintptr_t StoredOrFlag;
64
65 explicit NestedNameSpecifier(uintptr_t StoredOrFlag)
66 : StoredOrFlag(StoredOrFlag) {}
67 struct PtrKind {
68 StoredKind SK;
69 const void *Ptr;
70 };
71 explicit NestedNameSpecifier(PtrKind PK)
72 : StoredOrFlag(uintptr_t(PK.Ptr) | (uintptr_t(PK.SK) << FlagOffset)) {
73 assert(PK.Ptr != nullptr);
74 assert((uintptr_t(PK.Ptr) & ((1u << PtrOffset) - 1u)) == 0);
75 assert((uintptr_t(PK.Ptr) >> PtrOffset) != 0);
76 }
77
78 explicit constexpr NestedNameSpecifier(FlagKind K)
79 : StoredOrFlag(uintptr_t(K) << FlagOffset) {}
80
81 bool isStoredKind() const { return (StoredOrFlag >> PtrOffset) != 0; }
82
83 std::pair<StoredKind, const void *> getStored() const {
84 assert(isStoredKind());
85 return {StoredKind(StoredOrFlag >> FlagOffset & FlagMask),
86 reinterpret_cast<const void *>(StoredOrFlag & ~PtrMask)};
87 }
88
89 FlagKind getFlagKind() const {
90 assert(!isStoredKind());
91 return FlagKind(StoredOrFlag >> FlagOffset);
92 }
93
94 static const NamespaceAndPrefixStorage *
95 MakeNamespaceAndPrefixStorage(const ASTContext &Ctx,
97 NestedNameSpecifier Prefix);
98 static inline PtrKind MakeNamespacePtrKind(const ASTContext &Ctx,
100 NestedNameSpecifier Prefix);
101
102public:
103 static constexpr NestedNameSpecifier getGlobal() {
104 return NestedNameSpecifier(FlagKind::Global);
105 }
106
108
109 /// The kind of specifier that completes this nested name
110 /// specifier.
111 enum class Kind {
112 /// Empty.
113 Null,
114
115 /// The global specifier '::'. There is no stored value.
116 Global,
117
118 /// A type, stored as a Type*.
119 Type,
120
121 /// A namespace-like entity, stored as a NamespaceBaseDecl*.
123
124 /// Microsoft's '__super' specifier, stored as a CXXRecordDecl* of
125 /// the class it appeared in.
127 };
128
129 inline Kind getKind() const;
130
131 NestedNameSpecifier(std::nullopt_t) : StoredOrFlag(0) {}
132
133 explicit inline NestedNameSpecifier(const Type *T);
134
135 /// Builds a nested name specifier that names a namespace.
136 inline NestedNameSpecifier(const ASTContext &Ctx,
137 const NamespaceBaseDecl *Namespace,
138 NestedNameSpecifier Prefix);
139
140 /// Builds a nested name specifier that names a class through microsoft's
141 /// __super specifier.
142 explicit inline NestedNameSpecifier(CXXRecordDecl *RD);
143
144 explicit operator bool() const { return StoredOrFlag != 0; }
145
146 void *getAsVoidPointer() const {
147 return reinterpret_cast<void *>(StoredOrFlag);
148 }
149 static NestedNameSpecifier getFromVoidPointer(const void *Ptr) {
150 return NestedNameSpecifier(reinterpret_cast<uintptr_t>(Ptr));
151 }
152
153 const Type *getAsType() const {
154 auto [Kind, Ptr] = getStored();
155 assert(Kind == StoredKind::Type);
156 assert(Ptr != nullptr);
157 return static_cast<const Type *>(Ptr);
158 }
159
161
163 auto [Kind, Ptr] = getStored();
164 assert(Kind == StoredKind::NamespaceOrSuper);
165 assert(Ptr != nullptr);
166 return static_cast<CXXRecordDecl *>(const_cast<void *>(Ptr));
167 }
168
169 /// Retrieve the record declaration stored in this nested name
170 /// specifier, or null.
171 inline CXXRecordDecl *getAsRecordDecl() const;
172
173 friend bool operator==(NestedNameSpecifier LHS, NestedNameSpecifier RHS) {
174 return LHS.StoredOrFlag == RHS.StoredOrFlag;
175 }
176 friend bool operator!=(NestedNameSpecifier LHS, NestedNameSpecifier RHS) {
177 return LHS.StoredOrFlag != RHS.StoredOrFlag;
178 }
179
180 /// Retrieves the "canonical" nested name specifier for a
181 /// given nested name specifier.
182 ///
183 /// The canonical nested name specifier is a nested name specifier
184 /// that uniquely identifies a type or namespace within the type
185 /// system. For example, given:
186 ///
187 /// \code
188 /// namespace N {
189 /// struct S {
190 /// template<typename T> struct X { typename T* type; };
191 /// };
192 /// }
193 ///
194 /// template<typename T> struct Y {
195 /// typename N::S::X<T>::type member;
196 /// };
197 /// \endcode
198 ///
199 /// Here, the nested-name-specifier for N::S::X<T>:: will be
200 /// S::X<template-param-0-0>, since 'S' and 'X' are uniquely defined
201 /// by declarations in the type system and the canonical type for
202 /// the template type parameter 'T' is template-param-0-0.
203 inline NestedNameSpecifier getCanonical() const;
204
205 /// Whether this nested name specifier is canonical.
206 inline bool isCanonical() const;
207
208 /// Whether this nested name specifier starts with a '::'.
209 bool isFullyQualified() const;
210
211 NestedNameSpecifierDependence getDependence() const;
212
213 /// Whether this nested name specifier refers to a dependent
214 /// type or not.
215 bool isDependent() const {
216 return getDependence() & NestedNameSpecifierDependence::Dependent;
217 }
218
219 /// Whether this nested name specifier involves a template
220 /// parameter.
222 return getDependence() & NestedNameSpecifierDependence::Instantiation;
223 }
224
225 /// Whether this nested-name-specifier contains an unexpanded
226 /// parameter pack (for C++11 variadic templates).
228 return getDependence() & NestedNameSpecifierDependence::UnexpandedPack;
229 }
230
231 /// Whether this nested name specifier contains an error.
232 bool containsErrors() const {
233 return getDependence() & NestedNameSpecifierDependence::Error;
234 }
235
236 /// Print this nested name specifier to the given output stream. If
237 /// `ResolveTemplateArguments` is true, we'll print actual types, e.g.
238 /// `ns::SomeTemplate<int, MyClass>` instead of
239 /// `ns::SomeTemplate<Container::value_type, T>`.
240 void print(raw_ostream &OS, const PrintingPolicy &Policy,
241 bool ResolveTemplateArguments = false,
242 bool PrintFinalScopeResOp = true) const;
243
244 void Profile(llvm::FoldingSetNodeID &ID) const {
245 ID.AddInteger(StoredOrFlag);
246 }
247
248 /// Dump the nested name specifier to aid in debugging.
249 void dump(llvm::raw_ostream *OS = nullptr,
250 const LangOptions *LO = nullptr) const;
251 void dump(const LangOptions &LO) const;
252 void dump(llvm::raw_ostream &OS) const;
253 void dump(llvm::raw_ostream &OS, const LangOptions &LO) const;
254
255 static constexpr auto NumLowBitsAvailable = FlagOffset;
256};
257
262
264 llvm::FoldingSetNode {
268 std::pair<const NamespaceBaseDecl *, NestedNameSpecifier> getKey() const {
269 return {Namespace, Prefix};
270 }
271};
272
274 auto [Kind, Ptr] = getStored();
275 switch (Kind) {
276 case StoredKind::NamespaceOrSuper:
277 case StoredKind::NamespaceWithGlobal:
278 return {static_cast<const NamespaceBaseDecl *>(Ptr),
279 Kind == StoredKind::NamespaceWithGlobal
281 : std::nullopt};
282 case StoredKind::NamespaceWithNamespace:
283 return *static_cast<const NamespaceAndPrefixStorage *>(Ptr);
284 case StoredKind::Type:;
285 }
286 llvm_unreachable("unexpected stored kind");
287}
288
290
291/// A C++ nested-name-specifier augmented with source location
292/// information.
294 NestedNameSpecifier Qualifier = std::nullopt;
295 void *Data = nullptr;
296
297 /// Load a (possibly unaligned) source location from a given address
298 /// and offset.
299 SourceLocation LoadSourceLocation(unsigned Offset) const {
301 memcpy(&Raw, static_cast<char *>(Data) + Offset, sizeof(Raw));
303 }
304
305 /// Load a (possibly unaligned) pointer from a given address and
306 /// offset.
307 void *LoadPointer(unsigned Offset) const {
308 void *Result;
309 memcpy(&Result, static_cast<char *>(Data) + Offset, sizeof(void *));
310 return Result;
311 }
312
313 /// Determines the data length for the last component in the
314 /// given nested-name-specifier.
315 static inline unsigned getLocalDataLength(NestedNameSpecifier Qualifier);
316
317 /// Determines the data length for the entire
318 /// nested-name-specifier.
319 static inline unsigned getDataLength(NestedNameSpecifier Qualifier);
320
321public:
322 /// Construct an empty nested-name-specifier.
324
325 /// Construct a nested-name-specifier with source location information
326 /// from
328 : Qualifier(Qualifier), Data(Data) {}
329
330 /// Evaluates true when this nested-name-specifier location is
331 /// non-empty.
332 explicit operator bool() const { return bool(Qualifier); }
333
334 /// Evaluates true when this nested-name-specifier location is
335 /// non-empty.
336 bool hasQualifier() const { return bool(Qualifier); }
337
338 /// Retrieve the nested-name-specifier to which this instance
339 /// refers.
340 NestedNameSpecifier getNestedNameSpecifier() const { return Qualifier; }
341
342 /// Retrieve the opaque pointer that refers to source-location data.
343 void *getOpaqueData() const { return Data; }
344
345 /// Retrieve the source range covering the entirety of this
346 /// nested-name-specifier.
347 ///
348 /// For example, if this instance refers to a nested-name-specifier
349 /// \c \::std::vector<int>::, the returned source range would cover
350 /// from the initial '::' to the last '::'.
351 inline SourceRange getSourceRange() const LLVM_READONLY;
352
353 /// Retrieve the source range covering just the last part of
354 /// this nested-name-specifier, not including the prefix.
355 ///
356 /// Note that this is the source range of this NestedNameSpecifier chunk,
357 /// and for a type this includes the prefix of that type.
358 ///
359 /// For example, if this instance refers to a nested-name-specifier
360 /// \c \::std::vector<int>::, the returned source range would cover
361 /// from "vector" to the last '::'.
362 inline SourceRange getLocalSourceRange() const;
363
364 /// Retrieve the location of the beginning of this
365 /// nested-name-specifier.
367
368 /// Retrieve the location of the end of this
369 /// nested-name-specifier.
370 inline SourceLocation getEndLoc() const;
371
372 /// Retrieve the location of the beginning of this
373 /// component of the nested-name-specifier.
374 inline SourceLocation getLocalBeginLoc() const;
375
376 /// Retrieve the location of the end of this component of the
377 /// nested-name-specifier.
378 inline SourceLocation getLocalEndLoc() const;
379
380 /// For a nested-name-specifier that refers to a namespace,
381 /// retrieve the namespace and its prefix.
382 ///
383 /// For example, if this instance refers to a nested-name-specifier
384 /// \c \::std::chrono::, the prefix is \c \::std::. Note that the
385 /// returned prefix may be empty, if this is the first component of
386 /// the nested-name-specifier.
389
390 /// For a nested-name-specifier that refers to a type,
391 /// retrieve the type with source-location information.
392 inline TypeLoc castAsTypeLoc() const;
393 inline TypeLoc getAsTypeLoc() const;
394
395 /// Determines the data length for the entire
396 /// nested-name-specifier.
397 inline unsigned getDataLength() const;
398
400 return X.Qualifier == Y.Qualifier && X.Data == Y.Data;
401 }
402
404 return !(X == Y);
405 }
406};
407
409 const NamespaceBaseDecl *Namespace = nullptr;
411
412 explicit operator bool() const { return Namespace != nullptr; }
413};
414
415/// Class that aids in the construction of nested-name-specifiers along
416/// with source-location information for all of the components of the
417/// nested-name-specifier.
419 /// The current representation of the nested-name-specifier we're
420 /// building.
421 NestedNameSpecifier Representation = std::nullopt;
422
423 /// Buffer used to store source-location information for the
424 /// nested-name-specifier.
425 ///
426 /// Note that we explicitly manage the buffer (rather than using a
427 /// SmallVector) because \c Declarator expects it to be possible to memcpy()
428 /// a \c CXXScopeSpec, and CXXScopeSpec uses a NestedNameSpecifierLocBuilder.
429 char *Buffer = nullptr;
430
431 /// The size of the buffer used to store source-location information
432 /// for the nested-name-specifier.
433 unsigned BufferSize = 0;
434
435 /// The capacity of the buffer used to store source-location
436 /// information for the nested-name-specifier.
437 unsigned BufferCapacity = 0;
438
439 void PushTrivial(ASTContext &Context, NestedNameSpecifier Qualifier,
440 SourceRange R);
441
442public:
446
449
452
454 if (BufferCapacity)
455 free(Buffer);
456 }
457
458 /// Retrieve the representation of the nested-name-specifier.
459 NestedNameSpecifier getRepresentation() const { return Representation; }
460
461 /// Make a nested-name-specifier of the form 'type::'.
462 ///
463 /// \param Context The AST context in which this nested-name-specifier
464 /// resides.
465 ///
466 /// \param TL The TypeLoc that describes the type preceding the '::'.
467 ///
468 /// \param ColonColonLoc The location of the trailing '::'.
469 void Make(ASTContext &Context, TypeLoc TL, SourceLocation ColonColonLoc);
470
471 /// Extend the current nested-name-specifier by another
472 /// nested-name-specifier component of the form 'namespace::'.
473 ///
474 /// \param Context The AST context in which this nested-name-specifier
475 /// resides.
476 ///
477 /// \param Namespace The namespace.
478 ///
479 /// \param NamespaceLoc The location of the namespace name.
480 ///
481 /// \param ColonColonLoc The location of the trailing '::'.
482 void Extend(ASTContext &Context, const NamespaceBaseDecl *Namespace,
483 SourceLocation NamespaceLoc, SourceLocation ColonColonLoc);
484
485 /// Turn this (empty) nested-name-specifier into the global
486 /// nested-name-specifier '::'.
487 void MakeGlobal(ASTContext &Context, SourceLocation ColonColonLoc);
488
489 /// Turns this (empty) nested-name-specifier into '__super'
490 /// nested-name-specifier.
491 ///
492 /// \param Context The AST context in which this nested-name-specifier
493 /// resides.
494 ///
495 /// \param RD The declaration of the class in which nested-name-specifier
496 /// appeared.
497 ///
498 /// \param SuperLoc The location of the '__super' keyword.
499 /// name.
500 ///
501 /// \param ColonColonLoc The location of the trailing '::'.
503 SourceLocation SuperLoc,
504 SourceLocation ColonColonLoc);
505
506 /// Make a new nested-name-specifier from incomplete source-location
507 /// information.
508 ///
509 /// This routine should be used very, very rarely, in cases where we
510 /// need to synthesize a nested-name-specifier. Most code should instead use
511 /// \c Adopt() with a proper \c NestedNameSpecifierLoc.
513 SourceRange R) {
514 Representation = Qualifier;
515 BufferSize = 0;
516 PushTrivial(Context, Qualifier, R);
517 }
518
519 /// Adopt an existing nested-name-specifier (with source-range
520 /// information).
522
523 /// Retrieve the source range covered by this nested-name-specifier.
524 inline SourceRange getSourceRange() const LLVM_READONLY;
525
526 /// Retrieve a nested-name-specifier with location information,
527 /// copied into the given AST context.
528 ///
529 /// \param Context The context into which this nested-name-specifier will be
530 /// copied.
532
533 /// Retrieve a nested-name-specifier with location
534 /// information based on the information in this builder.
535 ///
536 /// This loc will contain references to the builder's internal data and may
537 /// be invalidated by any change to the builder.
539 return NestedNameSpecifierLoc(Representation, Buffer);
540 }
541
542 /// Clear out this builder, and prepare it to build another
543 /// nested-name-specifier with source-location information.
544 void Clear() {
545 Representation = std::nullopt;
546 BufferSize = 0;
547 }
548
549 /// Retrieve the underlying buffer.
550 ///
551 /// \returns A pair containing a pointer to the buffer of source-location
552 /// data and the size of the source-location data that resides in that
553 /// buffer.
554 std::pair<char *, unsigned> getBuffer() const {
555 return std::make_pair(Buffer, BufferSize);
556 }
557};
558
559/// Insertion operator for diagnostics. This allows sending
560/// NestedNameSpecifiers into a diagnostic with <<.
563 DB.AddTaggedVal(reinterpret_cast<uintptr_t>(NNS.getAsVoidPointer()),
565 return DB;
566}
567
568} // namespace clang
569
570namespace llvm {
571
572template <> struct PointerLikeTypeTraits<clang::NestedNameSpecifier> {
574 return P.getAsVoidPointer();
575 }
579 static constexpr int NumLowBitsAvailable =
581};
582
583} // namespace llvm
584
585#endif // LLVM_CLANG_AST_NESTEDNAMESPECIFIERBASE_H
Defines the Diagnostic-related interfaces.
#define X(type, name)
Definition Value.h:97
Defines the clang::SourceLocation class and associated facilities.
__DEVICE__ void * memcpy(void *__a, const void *__b, size_t __c)
Holds long-lived AST nodes (such as types and decls) that can be referred to throughout the semantic ...
Definition ASTContext.h:245
Represents a C++ struct/union/class.
Definition DeclCXX.h:258
@ ak_nestednamespec
NestedNameSpecifier *.
Definition Diagnostic.h:290
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...
This represents a decl that may have a name.
Definition Decl.h:275
Represents C++ namespaces and their aliases.
Definition Decl.h:574
void Adopt(NestedNameSpecifierLoc Other)
Adopt an existing nested-name-specifier (with source-range information).
NestedNameSpecifierLocBuilder & operator=(const NestedNameSpecifierLocBuilder &Other)
void MakeMicrosoftSuper(ASTContext &Context, CXXRecordDecl *RD, SourceLocation SuperLoc, SourceLocation ColonColonLoc)
Turns this (empty) nested-name-specifier into '__super' nested-name-specifier.
void MakeTrivial(ASTContext &Context, NestedNameSpecifier Qualifier, SourceRange R)
Make a new nested-name-specifier from incomplete source-location information.
void Clear()
Clear out this builder, and prepare it to build another nested-name-specifier with source-location in...
NestedNameSpecifierLoc getTemporary() const
Retrieve a nested-name-specifier with location information based on the information in this builder.
std::pair< char *, unsigned > getBuffer() const
Retrieve the underlying buffer.
SourceRange getSourceRange() const LLVM_READONLY
Retrieve the source range covered by this nested-name-specifier.
NestedNameSpecifier getRepresentation() const
Retrieve the representation of the nested-name-specifier.
void MakeGlobal(ASTContext &Context, SourceLocation ColonColonLoc)
Turn this (empty) nested-name-specifier into the global nested-name-specifier '::'.
NestedNameSpecifierLoc getWithLocInContext(ASTContext &Context) const
Retrieve a nested-name-specifier with location information, copied into the given AST context.
A C++ nested-name-specifier augmented with source location information.
NamespaceAndPrefixLoc getAsNamespaceAndPrefix() const
NestedNameSpecifier getNestedNameSpecifier() const
Retrieve the nested-name-specifier to which this instance refers.
SourceLocation getLocalEndLoc() const
Retrieve the location of the end of this component of the nested-name-specifier.
SourceRange getSourceRange() const LLVM_READONLY
Retrieve the source range covering the entirety of this nested-name-specifier.
NestedNameSpecifierLoc()=default
Construct an empty nested-name-specifier.
NamespaceAndPrefixLoc castAsNamespaceAndPrefix() const
For a nested-name-specifier that refers to a namespace, retrieve the namespace and its prefix.
NestedNameSpecifierLoc(NestedNameSpecifier Qualifier, void *Data)
Construct a nested-name-specifier with source location information from.
SourceLocation getEndLoc() const
Retrieve the location of the end of this nested-name-specifier.
SourceLocation getBeginLoc() const
Retrieve the location of the beginning of this nested-name-specifier.
friend bool operator!=(NestedNameSpecifierLoc X, NestedNameSpecifierLoc Y)
TypeLoc castAsTypeLoc() const
For a nested-name-specifier that refers to a type, retrieve the type with source-location information...
void * getOpaqueData() const
Retrieve the opaque pointer that refers to source-location data.
bool hasQualifier() const
Evaluates true when this nested-name-specifier location is non-empty.
SourceRange getLocalSourceRange() const
Retrieve the source range covering just the last part of this nested-name-specifier,...
SourceLocation getLocalBeginLoc() const
Retrieve the location of the beginning of this component of the nested-name-specifier.
unsigned getDataLength() const
Determines the data length for the entire nested-name-specifier.
Represents a C++ nested name specifier, such as "\::std::vector<int>::".
static constexpr NestedNameSpecifier getGlobal()
void dump(llvm::raw_ostream *OS=nullptr, const LangOptions *LO=nullptr) const
Dump the nested name specifier to aid in debugging.
NestedNameSpecifier getCanonical() const
Retrieves the "canonical" nested name specifier for a given nested name specifier.
bool isInstantiationDependent() const
Whether this nested name specifier involves a template parameter.
CXXRecordDecl * getAsMicrosoftSuper() const
NamespaceAndPrefix getAsNamespaceAndPrefix() const
bool isFullyQualified() const
Whether this nested name specifier starts with a '::'.
bool containsUnexpandedParameterPack() const
Whether this nested-name-specifier contains an unexpanded parameter pack (for C++11 variadic template...
void Profile(llvm::FoldingSetNodeID &ID) const
static constexpr auto NumLowBitsAvailable
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.
static NestedNameSpecifier getFromVoidPointer(const void *Ptr)
NestedNameSpecifierDependence getDependence() const
bool isCanonical() const
Whether this nested name specifier is canonical.
CXXRecordDecl * getAsRecordDecl() const
Retrieve the record declaration stored in this nested name specifier, or null.
bool containsErrors() const
Whether this nested name specifier contains an error.
friend bool operator==(NestedNameSpecifier LHS, NestedNameSpecifier RHS)
bool isDependent() const
Whether this nested name specifier refers to a dependent type or not.
friend bool operator!=(NestedNameSpecifier LHS, NestedNameSpecifier RHS)
Kind
The kind of specifier that completes this nested name specifier.
@ MicrosoftSuper
Microsoft's '__super' specifier, stored as a CXXRecordDecl* of the class it appeared in.
@ Namespace
A namespace-like entity, stored as a NamespaceBaseDecl*.
Encodes a location in the source.
static SourceLocation getFromRawEncoding(UIntTy Encoding)
Turn a raw encoding of a SourceLocation object into a real SourceLocation.
A trivial tuple used to represent a source range.
The streaming interface shared between DiagnosticBuilder and PartialDiagnostic.
void AddTaggedVal(uint64_t V, DiagnosticsEngine::ArgumentKind Kind) const
Base wrapper for a particular "section" of type source info.
Definition TypeLoc.h:59
The base class of the type hierarchy.
Definition TypeBase.h:1879
@ Extend
Lifetime-extend along this path.
Top level wrappers for InstallAPI frontend operations.
@ Result
The result type of a method or function.
Definition TypeBase.h:906
const FunctionProtoType * T
const StreamingDiagnostic & operator<<(const StreamingDiagnostic &DB, const ConceptReference *C)
Insertion operator for diagnostics.
@ Other
Other implicit parameter.
Definition Decl.h:1775
Diagnostic wrappers for TextAPI types for error reporting.
Definition Dominators.h:30
__UINTPTR_TYPE__ uintptr_t
An unsigned integer type with the property that any valid pointer to void can be converted to this ty...
const NamespaceBaseDecl * Namespace
NamespaceAndPrefixStorage(const NamespaceBaseDecl *Namespace, NestedNameSpecifier Prefix)
std::pair< const NamespaceBaseDecl *, NestedNameSpecifier > getKey() const
const NamespaceBaseDecl * Namespace
Describes how types, statements, expressions, and declarations should be printed.
static void * getAsVoidPointer(clang::NestedNameSpecifier P)
static clang::NestedNameSpecifier getFromVoidPointer(const void *P)