File tree Expand file tree Collapse file tree 2 files changed +15
-0
lines changed
Expand file tree Collapse file tree 2 files changed +15
-0
lines changed Original file line number Diff line number Diff line change @@ -773,6 +773,11 @@ bool Compiler<Emitter>::VisitCastExpr(const CastExpr *CE) {
773773 case CK_ToVoid:
774774 return discard (SubExpr);
775775
776+ case CK_Dynamic:
777+ // This initially goes through VisitCXXDynamicCastExpr, where we emit
778+ // a diagnostic if appropriate.
779+ return this ->delegate (SubExpr);
780+
776781 default :
777782 return this ->emitInvalid (CE);
778783 }
Original file line number Diff line number Diff line change @@ -1201,3 +1201,13 @@ namespace NonPureVirtualCall {
12011201
12021202 int main () { check (); }
12031203}
1204+
1205+ namespace DyamicCast {
1206+ struct X {
1207+ virtual constexpr ~X () {}
1208+ };
1209+ struct Y : X {};
1210+ constexpr Y y;
1211+ constexpr const X *p = &y;
1212+ constexpr const Y *q = dynamic_cast <const Y*>(p);
1213+ }
You can’t perform that action at this time.
0 commit comments