diff options
author | Chris Lattner <sabre@nondot.org> | 2009-12-06 20:58:07 +0000 |
---|---|---|
committer | Chris Lattner <sabre@nondot.org> | 2009-12-06 20:58:07 +0000 |
commit | 1ade4ca0aa9331c2388cca9becad1357a154ae34 (patch) | |
tree | c858d31b3a033c32ae3d0f737b17252b5a3ad35d /lib/Sema/SemaCXXScopeSpec.cpp | |
parent | d7d7f67c1dd8626520bb243d3928f59d32424534 (diff) |
revert my previous patch, it is breaking something and I don't have time
to fix it ATM.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@90717 91177308-0d34-0410-b5e6-96231b3b80d8
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, |