Commit 3a322efd by Jason Merrill Committed by Jason Merrill

re PR c++/54325 (C++11 uniform initialization syntax for argument-less abstract…

re PR c++/54325 (C++11 uniform initialization syntax for argument-less abstract base class constructor fails)

	PR c++/54325
	* call.c (build_new_method_call_1): Don't use build_value_init for
	user-provided default constructors.

From-SVN: r194820
parent 3fd005a6
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
......
......@@ -7534,6 +7534,9 @@ build_new_method_call_1 (tree instance, tree fns, vec<tree, va_gc> **args,
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);
......
// 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;
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment