When dynamic_cast'ing from a type to itself, fill in the cast kind

with CK_NoOp. Fixes PR7727.

llvm-svn: 109757
This commit is contained in:
Douglas Gregor 2010-07-29 16:12:45 +00:00
parent 029fd693cf
commit e9bf2d159c
1 changed files with 1 additions and 0 deletions

View 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;
}