diff options
author | Anders Carlsson <andersca@mac.com> | 2010-04-24 17:11:09 +0000 |
---|---|---|
committer | Anders Carlsson <andersca@mac.com> | 2010-04-24 17:11:09 +0000 |
commit | e25a96c0629b6f928d5e8055510789817db827d0 (patch) | |
tree | 5e49238185913d4e2c004317e4549d6a36a01296 /lib/Sema/SemaDeclCXX.cpp | |
parent | f1b48b7014992155286d58bb1676f9f51031d18b (diff) |
Pass the base specifiers through to CheckDerivedToBaseConversion. No functionality change yet.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@102250 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Sema/SemaDeclCXX.cpp')
-rw-r--r-- | lib/Sema/SemaDeclCXX.cpp | 29 |
1 files changed, 19 insertions, 10 deletions
diff --git a/lib/Sema/SemaDeclCXX.cpp b/lib/Sema/SemaDeclCXX.cpp index f1b1244b9e..243d854a94 100644 --- a/lib/Sema/SemaDeclCXX.cpp +++ b/lib/Sema/SemaDeclCXX.cpp @@ -723,7 +723,8 @@ Sema::CheckDerivedToBaseConversion(QualType Derived, QualType Base, unsigned InaccessibleBaseID, unsigned AmbigiousBaseConvID, SourceLocation Loc, SourceRange Range, - DeclarationName Name) { + DeclarationName Name, + CXXBaseSpecifierArray *BasePath) { // First, determine whether the path from Derived to Base is // ambiguous. This is slightly more expensive than checking whether // the Derived to Base conversion exists, because here we need to @@ -742,10 +743,16 @@ Sema::CheckDerivedToBaseConversion(QualType Derived, QualType Base, // Check that the base class can be accessed. switch (CheckBaseClassAccess(Loc, Base, Derived, Paths.front(), InaccessibleBaseID)) { - case AR_accessible: return false; - case AR_inaccessible: return true; - case AR_dependent: return false; - case AR_delayed: return false; + case AR_inaccessible: + return true; + case AR_accessible: + case AR_dependent: + case AR_delayed: + // Build a base path if necessary. + if (BasePath) { + // FIXME: Do this! + } + return false; } } @@ -775,12 +782,14 @@ Sema::CheckDerivedToBaseConversion(QualType Derived, QualType Base, bool Sema::CheckDerivedToBaseConversion(QualType Derived, QualType Base, SourceLocation Loc, SourceRange Range, + CXXBaseSpecifierArray *BasePath, bool IgnoreAccess) { return CheckDerivedToBaseConversion(Derived, Base, IgnoreAccess ? 0 : diag::err_upcast_to_inaccessible_base, diag::err_ambiguous_derived_to_base_conv, - Loc, Range, DeclarationName()); + Loc, Range, DeclarationName(), + BasePath); } @@ -5418,10 +5427,10 @@ bool Sema::CheckOverridingFunctionReturnType(const CXXMethodDecl *New, // Check if we the conversion from derived to base is valid. if (CheckDerivedToBaseConversion(NewClassTy, OldClassTy, - diag::err_covariant_return_inaccessible_base, - diag::err_covariant_return_ambiguous_derived_to_base_conv, - // FIXME: Should this point to the return type? - New->getLocation(), SourceRange(), New->getDeclName())) { + diag::err_covariant_return_inaccessible_base, + diag::err_covariant_return_ambiguous_derived_to_base_conv, + // FIXME: Should this point to the return type? + New->getLocation(), SourceRange(), New->getDeclName(), 0)) { Diag(Old->getLocation(), diag::note_overridden_virtual_function); return true; } |