diff options
Diffstat (limited to 'lib/Sema/SemaCXXScopeSpec.cpp')
-rw-r--r-- | lib/Sema/SemaCXXScopeSpec.cpp | 36 |
1 files changed, 4 insertions, 32 deletions
diff --git a/lib/Sema/SemaCXXScopeSpec.cpp b/lib/Sema/SemaCXXScopeSpec.cpp index 4a8dd62b44..14db77440f 100644 --- a/lib/Sema/SemaCXXScopeSpec.cpp +++ b/lib/Sema/SemaCXXScopeSpec.cpp @@ -330,9 +330,6 @@ NamedDecl *Sema::FindFirstQualifierInScope(Scope *S, NestedNameSpecifier *NNS) { /// that it contains an extra parameter \p ScopeLookupResult, which provides /// the result of name lookup within the scope of the nested-name-specifier /// that was computed at template definitino time. -/// -/// If EmitNoDiagnostics is true, this should not emit diagnostics, it should -/// just return null on failure. Sema::CXXScopeTy *Sema::BuildCXXNestedNameSpecifier(Scope *S, const CXXScopeSpec &SS, SourceLocation IdLoc, @@ -340,8 +337,7 @@ Sema::CXXScopeTy *Sema::BuildCXXNestedNameSpecifier(Scope *S, IdentifierInfo &II, QualType ObjectType, NamedDecl *ScopeLookupResult, - bool EnteringContext, - bool EmitNoDiagnostics) { + bool EnteringContext) { NestedNameSpecifier *Prefix = static_cast<NestedNameSpecifier *>(SS.getScopeRep()); @@ -446,17 +442,14 @@ Sema::CXXScopeTy *Sema::BuildCXXNestedNameSpecifier(Scope *S, !Context.hasSameType( Context.getTypeDeclType(cast<TypeDecl>(OuterDecl)), Context.getTypeDeclType(cast<TypeDecl>(SD))))) { - if (EmitNoDiagnostics) - return 0; - Diag(IdLoc, diag::err_nested_name_member_ref_lookup_ambiguous) << &II; Diag(SD->getLocation(), diag::note_ambig_member_ref_object_type) << ObjectType; Diag(OuterDecl->getLocation(), diag::note_ambig_member_ref_scope); - // Fall through so that we'll pick the name we found in the object - // type, since that's probably what the user wanted anyway. + // Fall through so that we'll pick the name we found in the object type, + // since that's probably what the user wanted anyway. } } @@ -476,11 +469,6 @@ Sema::CXXScopeTy *Sema::BuildCXXNestedNameSpecifier(Scope *S, T.getTypePtr()); } - // Otherwise, we have an error case. If we don't want diagnostics, just - // return an error now. - if (EmitNoDiagnostics) - return 0; - // If we didn't find anything during our lookup, try again with // ordinary name lookup, which can help us produce better error // messages. @@ -521,23 +509,7 @@ Sema::CXXScopeTy *Sema::ActOnCXXNestedNameSpecifier(Scope *S, bool EnteringContext) { return BuildCXXNestedNameSpecifier(S, SS, IdLoc, CCLoc, II, QualType::getFromOpaquePtr(ObjectTypePtr), - /*ScopeLookupResult=*/0, EnteringContext, - false); -} - -/// IsInvalidUnlessNestedName - This method is used for error recovery -/// purposes to determine whether the specified identifier is only valid as -/// a nested name specifier, for example a namespace name. It is -/// conservatively correct to always return false from this method. -/// -/// The arguments are the same as those passed to ActOnCXXNestedNameSpecifier. -bool Sema::IsInvalidUnlessNestedName(Scope *S, const CXXScopeSpec &SS, - IdentifierInfo &II, TypeTy *ObjectType, - bool EnteringContext) { - return BuildCXXNestedNameSpecifier(S, SS, SourceLocation(), SourceLocation(), - II, QualType::getFromOpaquePtr(ObjectType), - /*ScopeLookupResult=*/0, EnteringContext, - true); + /*ScopeLookupResult=*/0, EnteringContext); } Sema::CXXScopeTy *Sema::ActOnCXXNestedNameSpecifier(Scope *S, |