summaryrefslogtreecommitdiffstats
path: root/clang/lib/Sema/SemaCXXCast.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'clang/lib/Sema/SemaCXXCast.cpp')
-rw-r--r--clang/lib/Sema/SemaCXXCast.cpp8
1 files changed, 0 insertions, 8 deletions
diff --git a/clang/lib/Sema/SemaCXXCast.cpp b/clang/lib/Sema/SemaCXXCast.cpp
index 52a13ef5b29..31a772a5d8e 100644
--- a/clang/lib/Sema/SemaCXXCast.cpp
+++ b/clang/lib/Sema/SemaCXXCast.cpp
@@ -522,14 +522,6 @@ CheckDynamicCast(Sema &Self, ExprResult &SrcExpr, QualType DestType,
return;
}
- // If the source class is marked 'final', and the destination class does not
- // derive from the source class, then we know that the result is always null.
- if (SrcRecord->getDecl()->hasAttr<FinalAttr>() &&
- !Self.IsDerivedFrom(DestPointee, SrcPointee)) {
- Kind = CK_DynamicToNull;
- return;
- }
-
// C++ 5.2.7p5
// Upcasts are resolved statically.
if (DestRecord && Self.IsDerivedFrom(SrcPointee, DestPointee)) {
OpenPOWER on IntegriCloud