diff options
author | Sebastian Redl <sebastian.redl@getdesigned.at> | 2009-01-28 18:33:18 +0000 |
---|---|---|
committer | Sebastian Redl <sebastian.redl@getdesigned.at> | 2009-01-28 18:33:18 +0000 |
commit | 21593acb933324b439bc68b68e7cc7d1c3e3484d (patch) | |
tree | 6feee8a9f735cae4af555e7a7395a67e696d226d /lib/Sema/SemaInherit.cpp | |
parent | 66973121788ca645fe3d4a66179b9cfb6f2bce08 (diff) |
Implement pointer to member handling in static_cast.
Fix a stupid mistake in UnwrapSimilarPointers that made any two member pointers compatible as long as the pointee was the same.
Make a few style corrections as suggested by Chris.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@63215 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Sema/SemaInherit.cpp')
-rw-r--r-- | lib/Sema/SemaInherit.cpp | 9 |
1 files changed, 4 insertions, 5 deletions
diff --git a/lib/Sema/SemaInherit.cpp b/lib/Sema/SemaInherit.cpp index b5bd8939ad..307c527504 100644 --- a/lib/Sema/SemaInherit.cpp +++ b/lib/Sema/SemaInherit.cpp @@ -218,9 +218,9 @@ Sema::CheckDerivedToBaseConversion(QualType Derived, QualType Base, BasePaths Paths(/*FindAmbiguities=*/true, /*RecordPaths=*/false, /*DetectVirtual=*/false); bool DerivationOkay = IsDerivedFrom(Derived, Base, Paths); - assert(DerivationOkay && "Can only be used with a derived-to-base conversion"); - if (!DerivationOkay) - return true; + assert(DerivationOkay && + "Can only be used with a derived-to-base conversion"); + (void)DerivationOkay; if (!Paths.isAmbiguous(Context.getCanonicalType(Base).getUnqualifiedType())) return false; @@ -235,8 +235,7 @@ Sema::CheckDerivedToBaseConversion(QualType Derived, QualType Base, Paths.setRecordingPaths(true); bool StillOkay = IsDerivedFrom(Derived, Base, Paths); assert(StillOkay && "Can only be used with a derived-to-base conversion"); - if (!StillOkay) - return true; + (void)StillOkay; // Build up a textual representation of the ambiguous paths, e.g., // D -> B -> A, that will be used to illustrate the ambiguous |