]> granicus.if.org Git - clang/commitdiff
When dynamic_cast'ing from a type to itself, fill in the cast kind
authorDouglas Gregor <dgregor@apple.com>
Thu, 29 Jul 2010 16:12:45 +0000 (16:12 +0000)
committerDouglas Gregor <dgregor@apple.com>
Thu, 29 Jul 2010 16:12:45 +0000 (16:12 +0000)
with CK_NoOp. Fixes PR7727.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@109757 91177308-0d34-0410-b5e6-96231b3b80d8

lib/Sema/SemaCXXCast.cpp

index 29e9051082d204fb24e05db0f0def12728049c03..519d5692a3cc284e34f79b496e764ed720853054 100644 (file)
@@ -396,6 +396,7 @@ CheckDynamicCast(Sema &Self, Expr *&SrcExpr, QualType DestType,
   // C++ 5.2.7p3: If the type of v is the same as the required result type,
   //   [except for cv].
   if (DestRecord == SrcRecord) {
+    Kind = CastExpr::CK_NoOp;
     return;
   }