PR c++/54325
* call.c (build_new_method_call_1): Don't use build_value_init for
user-provided default constructors.
From-SVN: r194820
2013-01-02 Jason Merrill <jason@redhat.com>
+ PR c++/54325
+ * call.c (build_new_method_call_1): Don't use build_value_init for
+ user-provided default constructors.
+
* decl.c (check_default_argument): Use LOOKUP_IMPLICIT.
PR c++/55032
build_special_member_call. */
if (CONSTRUCTOR_NELTS (init_list) == 0
&& TYPE_HAS_DEFAULT_CONSTRUCTOR (basetype)
+ /* For a user-provided default constructor, use the normal
+ mechanisms so that protected access works. */
+ && !type_has_user_provided_default_constructor (basetype)
&& !processing_template_decl)
init = build_value_init (basetype, complain);
--- /dev/null
+// PR c++/54325
+// { dg-options -std=c++11 }
+
+class base
+{
+ protected:
+ base()
+ {}
+};
+
+class derived : public base
+{
+ public:
+ derived()
+ : base{} // <-- Note the c++11 curly brace syntax
+ {}
+};
+
+int main()
+{
+ derived d1;
+ return 0;
+}