NestedNameSpecifier.h revision 263508
1178825Sdfr//===--- NestedNameSpecifier.h - C++ nested name specifiers -----*- C++ -*-===// 2233294Sstas// 3233294Sstas// The LLVM Compiler Infrastructure 4233294Sstas// 5178825Sdfr// This file is distributed under the University of Illinois Open Source 6233294Sstas// License. See LICENSE.TXT for details. 7233294Sstas// 8233294Sstas//===----------------------------------------------------------------------===// 9178825Sdfr// 10233294Sstas// This file defines the NestedNameSpecifier class, which represents 11233294Sstas// a C++ nested-name-specifier. 12178825Sdfr// 13233294Sstas//===----------------------------------------------------------------------===// 14233294Sstas#ifndef LLVM_CLANG_AST_NESTEDNAMESPECIFIER_H 15233294Sstas#define LLVM_CLANG_AST_NESTEDNAMESPECIFIER_H 16178825Sdfr 17233294Sstas#include "clang/Basic/Diagnostic.h" 18233294Sstas#include "llvm/ADT/FoldingSet.h" 19233294Sstas#include "llvm/ADT/PointerIntPair.h" 20178825Sdfr#include "llvm/Support/Compiler.h" 21233294Sstas 22233294Sstasnamespace clang { 23233294Sstas 24233294Sstasclass ASTContext; 25233294Sstasclass NamespaceAliasDecl; 26233294Sstasclass NamespaceDecl; 27233294Sstasclass IdentifierInfo; 28233294Sstasstruct PrintingPolicy; 29233294Sstasclass Type; 30233294Sstasclass TypeLoc; 31233294Sstasclass LangOptions; 32178825Sdfr 33178825Sdfr/// \brief Represents a C++ nested name specifier, such as 34178825Sdfr/// "\::std::vector<int>::". 35178825Sdfr/// 36178825Sdfr/// C++ nested name specifiers are the prefixes to qualified 37178825Sdfr/// namespaces. For example, "foo::" in "foo::x" is a nested name 38178825Sdfr/// specifier. Nested name specifiers are made up of a sequence of 39178825Sdfr/// specifiers, each of which can be a namespace, type, identifier 40233294Sstas/// (for dependent names), decltype specifier, or the global specifier ('::'). 41178825Sdfr/// The last two specifiers can only appear at the start of a 42178825Sdfr/// nested-namespace-specifier. 43178825Sdfrclass NestedNameSpecifier : public llvm::FoldingSetNode { 44178825Sdfr 45233294Sstas /// \brief Enumeration describing 46178825Sdfr enum StoredSpecifierKind { 47178825Sdfr StoredIdentifier = 0, 48178825Sdfr StoredNamespaceOrAlias = 1, 49178825Sdfr StoredTypeSpec = 2, 50233294Sstas StoredTypeSpecWithTemplate = 3 51178825Sdfr }; 52178825Sdfr 53178825Sdfr /// \brief The nested name specifier that precedes this nested name 54233294Sstas /// specifier. 55233294Sstas /// 56233294Sstas /// The pointer is the nested-name-specifier that precedes this 57178825Sdfr /// one. The integer stores one of the first four values of type 58178825Sdfr /// SpecifierKind. 59178825Sdfr llvm::PointerIntPair<NestedNameSpecifier *, 2, StoredSpecifierKind> Prefix; 60178825Sdfr 61178825Sdfr /// \brief The last component in the nested name specifier, which 62178825Sdfr /// can be an identifier, a declaration, or a type. 63178825Sdfr /// 64178825Sdfr /// When the pointer is NULL, this specifier represents the global 65178825Sdfr /// specifier '::'. Otherwise, the pointer is one of 66233294Sstas /// IdentifierInfo*, Namespace*, or Type*, depending on the kind of 67178825Sdfr /// specifier as encoded within the prefix. 68178825Sdfr void* Specifier; 69178825Sdfr 70178825Sdfrpublic: 71178825Sdfr /// \brief The kind of specifier that completes this nested name 72233294Sstas /// specifier. 73178825Sdfr enum SpecifierKind { 74178825Sdfr /// \brief An identifier, stored as an IdentifierInfo*. 75178825Sdfr Identifier, 76178825Sdfr /// \brief A namespace, stored as a NamespaceDecl*. 77178825Sdfr Namespace, 78178825Sdfr /// \brief A namespace alias, stored as a NamespaceAliasDecl*. 79178825Sdfr NamespaceAlias, 80178825Sdfr /// \brief A type, stored as a Type*. 81178825Sdfr TypeSpec, 82178825Sdfr /// \brief A type that was preceded by the 'template' keyword, 83178825Sdfr /// stored as a Type*. 84233294Sstas TypeSpecWithTemplate, 85233294Sstas /// \brief The global specifier '::'. There is no stored value. 86178825Sdfr Global 87178825Sdfr }; 88178825Sdfr 89178825Sdfrprivate: 90178825Sdfr /// \brief Builds the global specifier. 91178825Sdfr NestedNameSpecifier() : Prefix(0, StoredIdentifier), Specifier(0) { } 92178825Sdfr 93178825Sdfr /// \brief Copy constructor used internally to clone nested name 94178825Sdfr /// specifiers. 95178825Sdfr NestedNameSpecifier(const NestedNameSpecifier &Other) 96178825Sdfr : llvm::FoldingSetNode(Other), Prefix(Other.Prefix), 97233294Sstas Specifier(Other.Specifier) { 98178825Sdfr } 99178825Sdfr 100178825Sdfr void operator=(const NestedNameSpecifier &) LLVM_DELETED_FUNCTION; 101178825Sdfr 102178825Sdfr /// \brief Either find or insert the given nested name specifier 103233294Sstas /// mockup in the given context. 104178825Sdfr static NestedNameSpecifier *FindOrInsert(const ASTContext &Context, 105178825Sdfr const NestedNameSpecifier &Mockup); 106178825Sdfr 107178825Sdfrpublic: 108178825Sdfr /// \brief Builds a specifier combining a prefix and an identifier. 109178825Sdfr /// 110178825Sdfr /// The prefix must be dependent, since nested name specifiers 111178825Sdfr /// referencing an identifier are only permitted when the identifier 112178825Sdfr /// cannot be resolved. 113178825Sdfr static NestedNameSpecifier *Create(const ASTContext &Context, 114178825Sdfr NestedNameSpecifier *Prefix, 115233294Sstas IdentifierInfo *II); 116178825Sdfr 117178825Sdfr /// \brief Builds a nested name specifier that names a namespace. 118178825Sdfr static NestedNameSpecifier *Create(const ASTContext &Context, 119178825Sdfr NestedNameSpecifier *Prefix, 120178825Sdfr const NamespaceDecl *NS); 121178825Sdfr 122233294Sstas /// \brief Builds a nested name specifier that names a namespace alias. 123233294Sstas static NestedNameSpecifier *Create(const ASTContext &Context, 124178825Sdfr NestedNameSpecifier *Prefix, 125178825Sdfr NamespaceAliasDecl *Alias); 126178825Sdfr 127178825Sdfr /// \brief Builds a nested name specifier that names a type. 128178825Sdfr static NestedNameSpecifier *Create(const ASTContext &Context, 129178825Sdfr NestedNameSpecifier *Prefix, 130178825Sdfr bool Template, const Type *T); 131178825Sdfr 132178825Sdfr /// \brief Builds a specifier that consists of just an identifier. 133178825Sdfr /// 134178825Sdfr /// The nested-name-specifier is assumed to be dependent, but has no 135178825Sdfr /// prefix because the prefix is implied by something outside of the 136178825Sdfr /// nested name specifier, e.g., in "x->Base::f", the "x" has a dependent 137178825Sdfr /// type. 138233294Sstas static NestedNameSpecifier *Create(const ASTContext &Context, 139233294Sstas IdentifierInfo *II); 140178825Sdfr 141178825Sdfr /// \brief Returns the nested name specifier representing the global 142178825Sdfr /// scope. 143178825Sdfr static NestedNameSpecifier *GlobalSpecifier(const ASTContext &Context); 144178825Sdfr 145178825Sdfr /// \brief Return the prefix of this nested name specifier. 146178825Sdfr /// 147178825Sdfr /// The prefix contains all of the parts of the nested name 148178825Sdfr /// specifier that preced this current specifier. For example, for a 149178825Sdfr /// nested name specifier that represents "foo::bar::", the current 150178825Sdfr /// specifier will contain "bar::" and the prefix will contain 151178825Sdfr /// "foo::". 152178825Sdfr NestedNameSpecifier *getPrefix() const { return Prefix.getPointer(); } 153178825Sdfr 154178825Sdfr /// \brief Determine what kind of nested name specifier is stored. 155233294Sstas SpecifierKind getKind() const; 156233294Sstas 157178825Sdfr /// \brief Retrieve the identifier stored in this nested name 158178825Sdfr /// specifier. 159178825Sdfr IdentifierInfo *getAsIdentifier() const { 160233294Sstas if (Prefix.getInt() == StoredIdentifier) 161178825Sdfr return (IdentifierInfo *)Specifier; 162178825Sdfr 163233294Sstas return 0; 164178825Sdfr } 165178825Sdfr 166178825Sdfr /// \brief Retrieve the namespace stored in this nested name 167178825Sdfr /// specifier. 168178825Sdfr NamespaceDecl *getAsNamespace() const; 169178825Sdfr 170178825Sdfr /// \brief Retrieve the namespace alias stored in this nested name 171178825Sdfr /// specifier. 172178825Sdfr NamespaceAliasDecl *getAsNamespaceAlias() const; 173233294Sstas 174178825Sdfr /// \brief Retrieve the type stored in this nested name specifier. 175178825Sdfr const Type *getAsType() const { 176178825Sdfr if (Prefix.getInt() == StoredTypeSpec || 177178825Sdfr Prefix.getInt() == StoredTypeSpecWithTemplate) 178178825Sdfr return (const Type *)Specifier; 179233294Sstas 180233294Sstas return 0; 181178825Sdfr } 182178825Sdfr 183233294Sstas /// \brief Whether this nested name specifier refers to a dependent 184178825Sdfr /// type or not. 185178825Sdfr bool isDependent() const; 186178825Sdfr 187178825Sdfr /// \brief Whether this nested name specifier involves a template 188178825Sdfr /// parameter. 189233294Sstas bool isInstantiationDependent() const; 190178825Sdfr 191178825Sdfr /// \brief Whether this nested-name-specifier contains an unexpanded 192178825Sdfr /// parameter pack (for C++11 variadic templates). 193178825Sdfr bool containsUnexpandedParameterPack() const; 194178825Sdfr 195178825Sdfr /// \brief Print this nested name specifier to the given output 196178825Sdfr /// stream. 197178825Sdfr void print(raw_ostream &OS, const PrintingPolicy &Policy) const; 198178825Sdfr 199178825Sdfr void Profile(llvm::FoldingSetNodeID &ID) const { 200178825Sdfr ID.AddPointer(Prefix.getOpaqueValue()); 201178825Sdfr ID.AddPointer(Specifier); 202178825Sdfr } 203178825Sdfr 204178825Sdfr /// \brief Dump the nested name specifier to standard output to aid 205178825Sdfr /// in debugging. 206178825Sdfr void dump(const LangOptions &LO); 207178825Sdfr}; 208178825Sdfr 209178825Sdfr/// \brief A C++ nested-name-specifier augmented with source location 210178825Sdfr/// information. 211178825Sdfrclass NestedNameSpecifierLoc { 212178825Sdfr NestedNameSpecifier *Qualifier; 213178825Sdfr void *Data; 214178825Sdfr 215178825Sdfr /// \brief Determines the data length for the last component in the 216178825Sdfr /// given nested-name-specifier. 217178825Sdfr static unsigned getLocalDataLength(NestedNameSpecifier *Qualifier); 218178825Sdfr 219178825Sdfr /// \brief Determines the data length for the entire 220178825Sdfr /// nested-name-specifier. 221178825Sdfr static unsigned getDataLength(NestedNameSpecifier *Qualifier); 222178825Sdfr 223178825Sdfrpublic: 224178825Sdfr /// \brief Construct an empty nested-name-specifier. 225178825Sdfr NestedNameSpecifierLoc() : Qualifier(0), Data(0) { } 226178825Sdfr 227178825Sdfr /// \brief Construct a nested-name-specifier with source location information 228178825Sdfr /// from 229178825Sdfr NestedNameSpecifierLoc(NestedNameSpecifier *Qualifier, void *Data) 230178825Sdfr : Qualifier(Qualifier), Data(Data) { } 231178825Sdfr 232178825Sdfr /// \brief Evalutes true when this nested-name-specifier location is 233178825Sdfr /// non-empty. 234178825Sdfr LLVM_EXPLICIT operator bool() const { return Qualifier; } 235178825Sdfr 236233294Sstas /// \brief Evalutes true when this nested-name-specifier location is 237233294Sstas /// empty. 238233294Sstas bool hasQualifier() const { return Qualifier; } 239233294Sstas 240233294Sstas /// \brief Retrieve the nested-name-specifier to which this instance 241233294Sstas /// refers. 242233294Sstas NestedNameSpecifier *getNestedNameSpecifier() const { 243233294Sstas return Qualifier; 244233294Sstas } 245233294Sstas 246233294Sstas /// \brief Retrieve the opaque pointer that refers to source-location data. 247233294Sstas void *getOpaqueData() const { return Data; } 248233294Sstas 249233294Sstas /// \brief Retrieve the source range covering the entirety of this 250178825Sdfr /// nested-name-specifier. 251178825Sdfr /// 252178825Sdfr /// For example, if this instance refers to a nested-name-specifier 253178825Sdfr /// \c \::std::vector<int>::, the returned source range would cover 254178825Sdfr /// from the initial '::' to the last '::'. 255178825Sdfr SourceRange getSourceRange() const LLVM_READONLY; 256178825Sdfr 257178825Sdfr /// \brief Retrieve the source range covering just the last part of 258178825Sdfr /// this nested-name-specifier, not including the prefix. 259178825Sdfr /// 260178825Sdfr /// For example, if this instance refers to a nested-name-specifier 261178825Sdfr /// \c \::std::vector<int>::, the returned source range would cover 262178825Sdfr /// from "vector" to the last '::'. 263178825Sdfr SourceRange getLocalSourceRange() const; 264233294Sstas 265178825Sdfr /// \brief Retrieve the location of the beginning of this 266178825Sdfr /// nested-name-specifier. 267178825Sdfr SourceLocation getBeginLoc() const { 268178825Sdfr return getSourceRange().getBegin(); 269178825Sdfr } 270178825Sdfr 271178825Sdfr /// \brief Retrieve the location of the end of this 272178825Sdfr /// nested-name-specifier. 273178825Sdfr SourceLocation getEndLoc() const { 274178825Sdfr return getSourceRange().getEnd(); 275178825Sdfr } 276178825Sdfr 277178825Sdfr /// \brief Retrieve the location of the beginning of this 278178825Sdfr /// component of the nested-name-specifier. 279178825Sdfr SourceLocation getLocalBeginLoc() const { 280233294Sstas return getLocalSourceRange().getBegin(); 281178825Sdfr } 282178825Sdfr 283178825Sdfr /// \brief Retrieve the location of the end of this component of the 284178825Sdfr /// nested-name-specifier. 285178825Sdfr SourceLocation getLocalEndLoc() const { 286178825Sdfr return getLocalSourceRange().getEnd(); 287178825Sdfr } 288178825Sdfr 289233294Sstas /// \brief Return the prefix of this nested-name-specifier. 290178825Sdfr /// 291178825Sdfr /// For example, if this instance refers to a nested-name-specifier 292178825Sdfr /// \c \::std::vector<int>::, the prefix is \c \::std::. Note that the 293178825Sdfr /// returned prefix may be empty, if this is the first component of 294178825Sdfr /// the nested-name-specifier. 295233294Sstas NestedNameSpecifierLoc getPrefix() const { 296178825Sdfr if (!Qualifier) 297178825Sdfr return *this; 298178825Sdfr 299233294Sstas return NestedNameSpecifierLoc(Qualifier->getPrefix(), Data); 300233294Sstas } 301233294Sstas 302178825Sdfr /// \brief For a nested-name-specifier that refers to a type, 303178825Sdfr /// retrieve the type with source-location information. 304178825Sdfr TypeLoc getTypeLoc() const; 305178825Sdfr 306178825Sdfr /// \brief Determines the data length for the entire 307178825Sdfr /// nested-name-specifier. 308178825Sdfr unsigned getDataLength() const { return getDataLength(Qualifier); } 309178825Sdfr 310178825Sdfr friend bool operator==(NestedNameSpecifierLoc X, 311178825Sdfr NestedNameSpecifierLoc Y) { 312178825Sdfr return X.Qualifier == Y.Qualifier && X.Data == Y.Data; 313233294Sstas } 314178825Sdfr 315178825Sdfr friend bool operator!=(NestedNameSpecifierLoc X, 316178825Sdfr NestedNameSpecifierLoc Y) { 317233294Sstas return !(X == Y); 318233294Sstas } 319233294Sstas}; 320178825Sdfr 321178825Sdfr/// \brief Class that aids in the construction of nested-name-specifiers along 322178825Sdfr/// with source-location information for all of the components of the 323233294Sstas/// nested-name-specifier. 324178825Sdfrclass NestedNameSpecifierLocBuilder { 325178825Sdfr /// \brief The current representation of the nested-name-specifier we're 326178825Sdfr /// building. 327233294Sstas NestedNameSpecifier *Representation; 328178825Sdfr 329178825Sdfr /// \brief Buffer used to store source-location information for the 330178825Sdfr /// nested-name-specifier. 331178825Sdfr /// 332178825Sdfr /// Note that we explicitly manage the buffer (rather than using a 333178825Sdfr /// SmallVector) because \c Declarator expects it to be possible to memcpy() 334178825Sdfr /// a \c CXXScopeSpec, and CXXScopeSpec uses a NestedNameSpecifierLocBuilder. 335233294Sstas char *Buffer; 336233294Sstas 337178825Sdfr /// \brief The size of the buffer used to store source-location information 338233294Sstas /// for the nested-name-specifier. 339233294Sstas unsigned BufferSize; 340178825Sdfr 341178825Sdfr /// \brief The capacity of the buffer used to store source-location 342178825Sdfr /// information for the nested-name-specifier. 343178825Sdfr unsigned BufferCapacity; 344178825Sdfr 345233294Sstaspublic: 346178825Sdfr NestedNameSpecifierLocBuilder() 347178825Sdfr : Representation(0), Buffer(0), BufferSize(0), BufferCapacity(0) { } 348178825Sdfr 349178825Sdfr NestedNameSpecifierLocBuilder(const NestedNameSpecifierLocBuilder &Other); 350178825Sdfr 351178825Sdfr NestedNameSpecifierLocBuilder & 352178825Sdfr operator=(const NestedNameSpecifierLocBuilder &Other); 353178825Sdfr 354178825Sdfr ~NestedNameSpecifierLocBuilder() { 355178825Sdfr if (BufferCapacity) 356178825Sdfr free(Buffer); 357178825Sdfr } 358178825Sdfr 359233294Sstas /// \brief Retrieve the representation of the nested-name-specifier. 360233294Sstas NestedNameSpecifier *getRepresentation() const { return Representation; } 361233294Sstas 362178825Sdfr /// \brief Extend the current nested-name-specifier by another 363178825Sdfr /// nested-name-specifier component of the form 'type::'. 364178825Sdfr /// 365178825Sdfr /// \param Context The AST context in which this nested-name-specifier 366233294Sstas /// resides. 367178825Sdfr /// 368178825Sdfr /// \param TemplateKWLoc The location of the 'template' keyword, if present. 369178825Sdfr /// 370178825Sdfr /// \param TL The TypeLoc that describes the type preceding the '::'. 371233294Sstas /// 372178825Sdfr /// \param ColonColonLoc The location of the trailing '::'. 373178825Sdfr void Extend(ASTContext &Context, SourceLocation TemplateKWLoc, TypeLoc TL, 374178825Sdfr SourceLocation ColonColonLoc); 375233294Sstas 376178825Sdfr /// \brief Extend the current nested-name-specifier by another 377178825Sdfr /// nested-name-specifier component of the form 'identifier::'. 378178825Sdfr /// 379178825Sdfr /// \param Context The AST context in which this nested-name-specifier 380178825Sdfr /// resides. 381178825Sdfr /// 382178825Sdfr /// \param Identifier The identifier. 383233294Sstas /// 384178825Sdfr /// \param IdentifierLoc The location of the identifier. 385178825Sdfr /// 386233294Sstas /// \param ColonColonLoc The location of the trailing '::'. 387178825Sdfr void Extend(ASTContext &Context, IdentifierInfo *Identifier, 388178825Sdfr SourceLocation IdentifierLoc, SourceLocation ColonColonLoc); 389178825Sdfr 390178825Sdfr /// \brief Extend the current nested-name-specifier by another 391178825Sdfr /// nested-name-specifier component of the form 'namespace::'. 392178825Sdfr /// 393178825Sdfr /// \param Context The AST context in which this nested-name-specifier 394178825Sdfr /// resides. 395178825Sdfr /// 396178825Sdfr /// \param Namespace The namespace. 397178825Sdfr /// 398178825Sdfr /// \param NamespaceLoc The location of the namespace name. 399178825Sdfr /// 400178825Sdfr /// \param ColonColonLoc The location of the trailing '::'. 401178825Sdfr void Extend(ASTContext &Context, NamespaceDecl *Namespace, 402233294Sstas SourceLocation NamespaceLoc, SourceLocation ColonColonLoc); 403178825Sdfr 404178825Sdfr /// \brief Extend the current nested-name-specifier by another 405178825Sdfr /// nested-name-specifier component of the form 'namespace-alias::'. 406178825Sdfr /// 407233294Sstas /// \param Context The AST context in which this nested-name-specifier 408178825Sdfr /// resides. 409178825Sdfr /// 410178825Sdfr /// \param Alias The namespace alias. 411178825Sdfr /// 412233294Sstas /// \param AliasLoc The location of the namespace alias 413178825Sdfr /// name. 414178825Sdfr /// 415178825Sdfr /// \param ColonColonLoc The location of the trailing '::'. 416178825Sdfr void Extend(ASTContext &Context, NamespaceAliasDecl *Alias, 417178825Sdfr SourceLocation AliasLoc, SourceLocation ColonColonLoc); 418178825Sdfr 419178825Sdfr /// \brief Turn this (empty) nested-name-specifier into the global 420178825Sdfr /// nested-name-specifier '::'. 421178825Sdfr void MakeGlobal(ASTContext &Context, SourceLocation ColonColonLoc); 422178825Sdfr 423178825Sdfr /// \brief Make a new nested-name-specifier from incomplete source-location 424178825Sdfr /// information. 425178825Sdfr /// 426178825Sdfr /// This routine should be used very, very rarely, in cases where we 427178825Sdfr /// need to synthesize a nested-name-specifier. Most code should instead use 428178825Sdfr /// \c Adopt() with a proper \c NestedNameSpecifierLoc. 429178825Sdfr void MakeTrivial(ASTContext &Context, NestedNameSpecifier *Qualifier, 430178825Sdfr SourceRange R); 431178825Sdfr 432178825Sdfr /// \brief Adopt an existing nested-name-specifier (with source-range 433178825Sdfr /// information). 434178825Sdfr void Adopt(NestedNameSpecifierLoc Other); 435 436 /// \brief Retrieve the source range covered by this nested-name-specifier. 437 SourceRange getSourceRange() const LLVM_READONLY { 438 return NestedNameSpecifierLoc(Representation, Buffer).getSourceRange(); 439 } 440 441 /// \brief Retrieve a nested-name-specifier with location information, 442 /// copied into the given AST context. 443 /// 444 /// \param Context The context into which this nested-name-specifier will be 445 /// copied. 446 NestedNameSpecifierLoc getWithLocInContext(ASTContext &Context) const; 447 448 /// \brief Retrieve a nested-name-specifier with location 449 /// information based on the information in this builder. 450 /// 451 /// This loc will contain references to the builder's internal data and may 452 /// be invalidated by any change to the builder. 453 NestedNameSpecifierLoc getTemporary() const { 454 return NestedNameSpecifierLoc(Representation, Buffer); 455 } 456 457 /// \brief Clear out this builder, and prepare it to build another 458 /// nested-name-specifier with source-location information. 459 void Clear() { 460 Representation = 0; 461 BufferSize = 0; 462 } 463 464 /// \brief Retrieve the underlying buffer. 465 /// 466 /// \returns A pair containing a pointer to the buffer of source-location 467 /// data and the size of the source-location data that resides in that 468 /// buffer. 469 std::pair<char *, unsigned> getBuffer() const { 470 return std::make_pair(Buffer, BufferSize); 471 } 472}; 473 474/// Insertion operator for diagnostics. This allows sending 475/// NestedNameSpecifiers into a diagnostic with <<. 476inline const DiagnosticBuilder &operator<<(const DiagnosticBuilder &DB, 477 NestedNameSpecifier *NNS) { 478 DB.AddTaggedVal(reinterpret_cast<intptr_t>(NNS), 479 DiagnosticsEngine::ak_nestednamespec); 480 return DB; 481} 482 483} 484 485#endif 486