+2018-02-01 Paolo Carlini <paolo.carlini@oracle.com>
+
+ PR c++/83796
+ * call.c (convert_like_real): If w're initializing from {} explicitly
+ call abstract_virtuals_error_sfinae.
+
2018-01-31 Jason Merrill <jason@redhat.com>
Jakub Jelinek <jakub@redhat.com>
&& TYPE_HAS_DEFAULT_CONSTRUCTOR (totype))
{
bool direct = CONSTRUCTOR_IS_DIRECT_INIT (expr);
+ if (abstract_virtuals_error_sfinae (NULL_TREE, totype, complain))
+ return error_mark_node;
expr = build_value_init (totype, complain);
expr = get_target_expr_sfinae (expr, complain);
if (expr != error_mark_node)
+2018-02-01 Paolo Carlini <paolo.carlini@oracle.com>
+
+ PR c++/83796
+ * g++.dg/cpp0x/abstract-default1.C: New.
+
2018-02-01 Richard Sandiford <richard.sandiford@linaro.org>
PR tree-optimization/81635
--- /dev/null
+// PR c++/83796
+// { dg-do compile { target c++11 } }
+
+struct MyAbstractClass
+{
+ virtual int foo() const = 0;
+};
+
+struct TestClass
+{
+ TestClass(const MyAbstractClass& m = {}) // { dg-error "abstract type" }
+ : value_(m.foo()) {}
+
+ int value_;
+};
+
+int TestFunction(const MyAbstractClass& m = {}) // { dg-error "abstract type" }
+{
+ return m.foo();
+}
+
+int main()
+{
+ TestClass testInstance; // { dg-error "abstract type" }
+ TestFunction(); // { dg-error "abstract type" }
+}