aboutsummaryrefslogtreecommitdiff
path: root/lib/Sema/SemaInherit.cpp
diff options
context:
space:
mode:
authorAnders Carlsson <andersca@mac.com>2009-03-27 05:05:05 +0000
committerAnders Carlsson <andersca@mac.com>2009-03-27 05:05:05 +0000
commit29f006be830fbbcaa0c1cf7c7399bb5080dc7f32 (patch)
treed3f55faa39e3c7fdede78c40dec2b97722b4fe07 /lib/Sema/SemaInherit.cpp
parentc60e88819a273d54faa71a2cd6c3d79dd48c12e0 (diff)
Add a stubbed out CheckBaseClassAccess method.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@67821 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Sema/SemaInherit.cpp')
-rw-r--r--lib/Sema/SemaInherit.cpp10
1 files changed, 6 insertions, 4 deletions
diff --git a/lib/Sema/SemaInherit.cpp b/lib/Sema/SemaInherit.cpp
index ce95a1e614..c572f62d61 100644
--- a/lib/Sema/SemaInherit.cpp
+++ b/lib/Sema/SemaInherit.cpp
@@ -202,7 +202,7 @@ bool Sema::LookupInBases(CXXRecordDecl *Class,
/// CheckDerivedToBaseConversion - Check whether the Derived-to-Base
/// conversion (where Derived and Base are class types) is
/// well-formed, meaning that the conversion is unambiguous (and
-/// FIXME: that all of the base classes are accessible). Returns true
+/// that all of the base classes are accessible). Returns true
/// and emits a diagnostic if the code is ill-formed, returns false
/// otherwise. Loc is the location where this routine should point to
/// if there is an error, and Range is the source range to highlight
@@ -214,15 +214,17 @@ Sema::CheckDerivedToBaseConversion(QualType Derived, QualType Base,
// ambiguous. This is slightly more expensive than checking whether
// the Derived to Base conversion exists, because here we need to
// explore multiple paths to determine if there is an ambiguity.
- BasePaths Paths(/*FindAmbiguities=*/true, /*RecordPaths=*/false,
+ BasePaths Paths(/*FindAmbiguities=*/true, /*RecordPaths=*/true,
/*DetectVirtual=*/false);
bool DerivationOkay = IsDerivedFrom(Derived, Base, Paths);
assert(DerivationOkay &&
"Can only be used with a derived-to-base conversion");
(void)DerivationOkay;
- if (!Paths.isAmbiguous(Context.getCanonicalType(Base).getUnqualifiedType()))
- return false;
+ if (!Paths.isAmbiguous(Context.getCanonicalType(Base).getUnqualifiedType())) {
+ // Check that the base class can be accessed.
+ return CheckBaseClassAccess(Derived, Base, Paths, Loc);
+ }
// We know that the derived-to-base conversion is ambiguous, and
// we're going to produce a diagnostic. Perform the derived-to-base