diff options
| author | 2017-01-14 19:55:43 +0000 | |
|---|---|---|
| committer | 2017-01-14 19:55:43 +0000 | |
| commit | bd3306aecb3a15e8967143b8cdbbccf2b1b19b74 (patch) | |
| tree | 309a8132b44564b9e634c0da6815187ce8eab27c /gnu/llvm/tools/clang/lib/AST/NestedNameSpecifier.cpp | |
| parent | killp -a should not kill the window if only one pane. (diff) | |
| download | wireguard-openbsd-bd3306aecb3a15e8967143b8cdbbccf2b1b19b74.tar.xz wireguard-openbsd-bd3306aecb3a15e8967143b8cdbbccf2b1b19b74.zip | |
Import LLVM 3.9.1 including clang and lld.
Diffstat (limited to 'gnu/llvm/tools/clang/lib/AST/NestedNameSpecifier.cpp')
| -rw-r--r-- | gnu/llvm/tools/clang/lib/AST/NestedNameSpecifier.cpp | 17 |
1 files changed, 13 insertions, 4 deletions
diff --git a/gnu/llvm/tools/clang/lib/AST/NestedNameSpecifier.cpp b/gnu/llvm/tools/clang/lib/AST/NestedNameSpecifier.cpp index d2370c88b9c..82809d7ea7b 100644 --- a/gnu/llvm/tools/clang/lib/AST/NestedNameSpecifier.cpp +++ b/gnu/llvm/tools/clang/lib/AST/NestedNameSpecifier.cpp @@ -171,10 +171,19 @@ NamespaceAliasDecl *NestedNameSpecifier::getAsNamespaceAlias() const { /// \brief Retrieve the record declaration stored in this nested name specifier. CXXRecordDecl *NestedNameSpecifier::getAsRecordDecl() const { - if (Prefix.getInt() == StoredDecl) + switch (Prefix.getInt()) { + case StoredIdentifier: + return nullptr; + + case StoredDecl: return dyn_cast<CXXRecordDecl>(static_cast<NamedDecl *>(Specifier)); - return nullptr; + case StoredTypeSpec: + case StoredTypeSpecWithTemplate: + return getAsType()->getAsCXXRecordDecl(); + } + + llvm_unreachable("Invalid NNS Kind!"); } /// \brief Whether this nested name specifier refers to a dependent @@ -306,7 +315,7 @@ NestedNameSpecifier::print(raw_ostream &OS, // Print the template argument list. TemplateSpecializationType::PrintTemplateArgumentList( - OS, SpecType->getArgs(), SpecType->getNumArgs(), InnerPolicy); + OS, SpecType->template_arguments(), InnerPolicy); } else { // Print the type normally QualType(T, 0).print(OS, InnerPolicy); @@ -322,7 +331,7 @@ void NestedNameSpecifier::dump(const LangOptions &LO) const { print(llvm::errs(), PrintingPolicy(LO)); } -void NestedNameSpecifier::dump() const { +LLVM_DUMP_METHOD void NestedNameSpecifier::dump() const { LangOptions LO; print(llvm::errs(), PrintingPolicy(LO)); } |
