diff options
author | Aaron Ballman <aaron@aaronballman.com> | 2014-01-03 13:56:08 +0000 |
---|---|---|
committer | Aaron Ballman <aaron@aaronballman.com> | 2014-01-03 13:56:08 +0000 |
commit | 4a97967b5fd77b28a1812a4898d3e1a4a10cb8b3 (patch) | |
tree | 23d3fa5bd70c7b4a903d2a64849cd6af685ae813 /clang/lib/Sema/SemaDeclCXX.cpp | |
parent | 5fe6c805dc8dedbf34b142a3e40f77aeccc85ba9 (diff) | |
download | bcm5719-llvm-4a97967b5fd77b28a1812a4898d3e1a4a10cb8b3.tar.gz bcm5719-llvm-4a97967b5fd77b28a1812a4898d3e1a4a10cb8b3.zip |
It turns out the problem was a bit more wide-spread. Removing a lot of unneeded typecasts. getScopeRep() already returns a NestedNameSpecifier.
No functional changes intended.
llvm-svn: 198414
Diffstat (limited to 'clang/lib/Sema/SemaDeclCXX.cpp')
-rw-r--r-- | clang/lib/Sema/SemaDeclCXX.cpp | 18 |
1 files changed, 7 insertions, 11 deletions
diff --git a/clang/lib/Sema/SemaDeclCXX.cpp b/clang/lib/Sema/SemaDeclCXX.cpp index e78c0247eb4..91b9c6a5880 100644 --- a/clang/lib/Sema/SemaDeclCXX.cpp +++ b/clang/lib/Sema/SemaDeclCXX.cpp @@ -2640,13 +2640,10 @@ Sema::BuildMemInitializer(Decl *ConstructorD, if (BaseType.isNull()) { BaseType = Context.getTypeDeclType(TyD); - if (SS.isSet()) { - NestedNameSpecifier *Qualifier = - static_cast<NestedNameSpecifier*>(SS.getScopeRep()); - + if (SS.isSet()) // FIXME: preserve source range information - BaseType = Context.getElaboratedType(ETK_None, Qualifier, BaseType); - } + BaseType = Context.getElaboratedType(ETK_None, SS.getScopeRep(), + BaseType); } } @@ -6976,7 +6973,7 @@ Decl *Sema::ActOnUsingDirective(Scope *S, UsingDirectiveDecl *UDir = 0; NestedNameSpecifier *Qualifier = 0; if (SS.isSet()) - Qualifier = static_cast<NestedNameSpecifier *>(SS.getScopeRep()); + Qualifier = SS.getScopeRep(); // Lookup namespace name. LookupResult R(*this, NamespcName, IdentLoc, LookupNamespaceName); @@ -7624,8 +7621,7 @@ bool Sema::CheckUsingDeclRedeclaration(SourceLocation UsingLoc, if (!CurContext->getRedeclContext()->isRecord()) return false; - NestedNameSpecifier *Qual - = static_cast<NestedNameSpecifier*>(SS.getScopeRep()); + NestedNameSpecifier *Qual = SS.getScopeRep(); for (LookupResult::iterator I = Prev.begin(), E = Prev.end(); I != E; ++I) { NamedDecl *D = *I; @@ -7733,7 +7729,7 @@ bool Sema::CheckUsingDeclQualifier(SourceLocation UsingLoc, Diag(SS.getRange().getBegin(), diag::err_using_decl_nested_name_specifier_is_not_base_class) - << (NestedNameSpecifier*) SS.getScopeRep() + << SS.getScopeRep() << cast<CXXRecordDecl>(CurContext) << SS.getRange(); return true; @@ -7793,7 +7789,7 @@ bool Sema::CheckUsingDeclQualifier(SourceLocation UsingLoc, Diag(SS.getRange().getBegin(), diag::err_using_decl_nested_name_specifier_is_not_base_class) - << (NestedNameSpecifier*) SS.getScopeRep() + << SS.getScopeRep() << cast<CXXRecordDecl>(CurContext) << SS.getRange(); |