r177954 - Remove some no-op static_casts.

Richard Smith richard-llvm at metafoo.co.uk
Mon Mar 25 17:54:11 PDT 2013


Author: rsmith
Date: Mon Mar 25 19:54:11 2013
New Revision: 177954

URL: http://llvm.org/viewvc/llvm-project?rev=177954&view=rev
Log:
Remove some no-op static_casts.

Modified:
    cfe/trunk/lib/Sema/SemaCXXScopeSpec.cpp

Modified: cfe/trunk/lib/Sema/SemaCXXScopeSpec.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Sema/SemaCXXScopeSpec.cpp?rev=177954&r1=177953&r2=177954&view=diff
==============================================================================
--- cfe/trunk/lib/Sema/SemaCXXScopeSpec.cpp (original)
+++ cfe/trunk/lib/Sema/SemaCXXScopeSpec.cpp Mon Mar 25 19:54:11 2013
@@ -78,8 +78,7 @@ DeclContext *Sema::computeDeclContext(co
   if (!SS.isSet() || SS.isInvalid())
     return 0;
 
-  NestedNameSpecifier *NNS
-    = static_cast<NestedNameSpecifier *>(SS.getScopeRep());
+  NestedNameSpecifier *NNS = SS.getScopeRep();
   if (NNS->isDependent()) {
     // If this nested-name-specifier refers to the current
     // instantiation, return its DeclContext.
@@ -158,9 +157,7 @@ bool Sema::isDependentScopeSpecifier(con
   if (!SS.isSet() || SS.isInvalid())
     return false;
 
-  NestedNameSpecifier *NNS
-    = static_cast<NestedNameSpecifier *>(SS.getScopeRep());
-  return NNS->isDependent();
+  return SS.getScopeRep()->isDependent();
 }
 
 // \brief Determine whether this C++ scope specifier refers to an
@@ -170,9 +167,7 @@ bool Sema::isUnknownSpecialization(const
   if (!isDependentScopeSpecifier(SS))
     return false;
 
-  NestedNameSpecifier *NNS
-    = static_cast<NestedNameSpecifier *>(SS.getScopeRep());
-  return getCurrentInstantiationOf(NNS) == 0;
+  return getCurrentInstantiationOf(SS.getScopeRep()) == 0;
 }
 
 /// \brief If the given nested name specifier refers to the current
@@ -769,8 +764,7 @@ bool Sema::ActOnCXXNestedNameSpecifier(S
   if (DependentTemplateName *DTN = Template.get().getAsDependentTemplateName()){
     // Handle a dependent template specialization for which we cannot resolve
     // the template name.
-    assert(DTN->getQualifier()
-             == static_cast<NestedNameSpecifier*>(SS.getScopeRep()));
+    assert(DTN->getQualifier() == SS.getScopeRep());
     QualType T = Context.getDependentTemplateSpecializationType(ETK_None,
                                                           DTN->getQualifier(),
                                                           DTN->getIdentifier(),
@@ -877,8 +871,7 @@ void Sema::RestoreNestedNameSpecifierAnn
 bool Sema::ShouldEnterDeclaratorScope(Scope *S, const CXXScopeSpec &SS) {
   assert(SS.isSet() && "Parser passed invalid CXXScopeSpec.");
 
-  NestedNameSpecifier *Qualifier =
-    static_cast<NestedNameSpecifier*>(SS.getScopeRep());
+  NestedNameSpecifier *Qualifier = SS.getScopeRep();
 
   // There are only two places a well-formed program may qualify a
   // declarator: first, when defining a namespace or class member





More information about the cfe-commits mailing list