def err_throw_abstract_type : Error<
"cannot throw an object of abstract type %0">;
def err_array_of_abstract_type : Error<"array of abstract class type %0">;
+def err_capture_of_abstract_type : Error<
+ "by-copy capture of value of abstract type %0">;
def err_multiple_final_overriders : Error<
"virtual function %q0 has more than one final overrider in %1">;
}
return false;
}
+
+ if (S.RequireNonAbstractType(Loc, CaptureType,
+ diag::err_capture_of_abstract_type))
+ return false;
}
// Capture this variable in the lambda.
}
};
+namespace rdar14468891 {
+ class X {
+ public:
+ virtual ~X() = 0; // expected-note{{unimplemented pure virtual method '~X' in 'X'}}
+ };
+
+ class Y : public X { };
+
+ void capture(X &x) {
+ [x]() {}(); // expected-error{{by-copy capture of value of abstract type 'rdar14468891::X'}}
+ }
+}