summaryrefslogtreecommitdiffstats
path: root/clang/lib/Sema/SemaDeclCXX.cpp
diff options
context:
space:
mode:
authorAnders Carlsson <andersca@mac.com>2010-04-24 17:11:09 +0000
committerAnders Carlsson <andersca@mac.com>2010-04-24 17:11:09 +0000
commit7afe4245e27d0b44c7984d853c6d50f36e42ba04 (patch)
tree5516c69efa3b40cc475d1f7b6c9b45a4fc999026 /clang/lib/Sema/SemaDeclCXX.cpp
parent0c509eeac7353a27bd5812136cc454b4e34c2ff1 (diff)
downloadbcm5719-llvm-7afe4245e27d0b44c7984d853c6d50f36e42ba04.tar.gz
bcm5719-llvm-7afe4245e27d0b44c7984d853c6d50f36e42ba04.zip
Pass the base specifiers through to CheckDerivedToBaseConversion. No functionality change yet.
llvm-svn: 102250
Diffstat (limited to 'clang/lib/Sema/SemaDeclCXX.cpp')
-rw-r--r--clang/lib/Sema/SemaDeclCXX.cpp29
1 files changed, 19 insertions, 10 deletions
diff --git a/clang/lib/Sema/SemaDeclCXX.cpp b/clang/lib/Sema/SemaDeclCXX.cpp
index f1b1244b9e3..243d854a941 100644
--- a/clang/lib/Sema/SemaDeclCXX.cpp
+++ b/clang/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;
}
OpenPOWER on IntegriCloud