CastKind &Kind, bool ListInitialization) {
if (DestType->isRecordType()) {
if (Self.RequireCompleteType(OpRange.getBegin(), DestType,
- diag::err_bad_dynamic_cast_incomplete)) {
+ diag::err_bad_dynamic_cast_incomplete) ||
+ Self.RequireNonAbstractType(OpRange.getBegin(), DestType,\r
+ diag::err_allocation_of_abstract_type)) {
msg = 0;
return TC_Failed;
}
};
};
}
+
+namespace pr12658 {
+ class C {\r
+ public:\r
+ C(int v){}\r
+ virtual void f() = 0; // expected-note {{unimplemented pure virtual method 'f' in 'C'}}\r
+ };\r
+\r
+ void foo( C& c ) {}\r
+\r
+ void bar( void ) {\r
+ foo(C(99)); // expected-error {{allocating an object of abstract class type 'pr12658::C'}}\r
+ }
+}