Commit 17434237 by Jason Merrill Committed by Jason Merrill

PR c++/85262 - ICE with redundant qualification on constructor.

	* call.c (build_new_method_call_1): Move make_args_non_dependent
	after A::A() handling.

From-SVN: r259255
parent e9f59cfa
2018-04-09 Jason Merrill <jason@redhat.com> 2018-04-09 Jason Merrill <jason@redhat.com>
PR c++/85262 - ICE with redundant qualification on constructor.
* call.c (build_new_method_call_1): Move make_args_non_dependent
after A::A() handling.
PR c++/85277 - ICE with invalid offsetof. PR c++/85277 - ICE with invalid offsetof.
* semantics.c (finish_offsetof): Avoid passing non-DECL to %qD. * semantics.c (finish_offsetof): Avoid passing non-DECL to %qD.
Adjust -Winvalid-offsetof diagnostic to say conditionally supported. Adjust -Winvalid-offsetof diagnostic to say conditionally supported.
......
...@@ -9104,14 +9104,6 @@ build_new_method_call_1 (tree instance, tree fns, vec<tree, va_gc> **args, ...@@ -9104,14 +9104,6 @@ build_new_method_call_1 (tree instance, tree fns, vec<tree, va_gc> **args,
basetype = TYPE_MAIN_VARIANT (TREE_TYPE (instance)); basetype = TYPE_MAIN_VARIANT (TREE_TYPE (instance));
gcc_assert (CLASS_TYPE_P (basetype)); gcc_assert (CLASS_TYPE_P (basetype));
if (processing_template_decl)
{
orig_args = args == NULL ? NULL : make_tree_vector_copy (*args);
instance = build_non_dependent_expr (instance);
if (args != NULL)
make_args_non_dependent (*args);
}
user_args = args == NULL ? NULL : *args; user_args = args == NULL ? NULL : *args;
/* Under DR 147 A::A() is an invalid constructor call, /* Under DR 147 A::A() is an invalid constructor call,
not a functional cast. */ not a functional cast. */
...@@ -9132,12 +9124,21 @@ build_new_method_call_1 (tree instance, tree fns, vec<tree, va_gc> **args, ...@@ -9132,12 +9124,21 @@ build_new_method_call_1 (tree instance, tree fns, vec<tree, va_gc> **args,
return call; return call;
} }
if (processing_template_decl)
{
orig_args = args == NULL ? NULL : make_tree_vector_copy (*args);
instance = build_non_dependent_expr (instance);
if (args != NULL)
make_args_non_dependent (*args);
}
/* Process the argument list. */ /* Process the argument list. */
if (args != NULL && *args != NULL) if (args != NULL && *args != NULL)
{ {
*args = resolve_args (*args, complain); *args = resolve_args (*args, complain);
if (*args == NULL) if (*args == NULL)
return error_mark_node; return error_mark_node;
user_args = *args;
} }
/* Consider the object argument to be used even if we end up selecting a /* Consider the object argument to be used even if we end up selecting a
......
// PR c++/85262
// { dg-options -fpermissive }
struct A {};
template<int> struct B : A
{
B()
{
A::A(A()); // { dg-warning "constructor" }
}
};
B<0> b;
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