Commit 85a273ba by Jason Merrill Committed by Jason Merrill

re PR c++/48115 (internal compiler error: in type_has_nontrivial_copy_init, at cp/tree.c:2482)

	PR c++/48115
	* call.c (convert_arg_to_ellipsis): Handle incomplete type.

From-SVN: r171066
parent 51fd6b90
2011-03-16 Jason Merrill <jason@redhat.com>
PR c++/48115
* call.c (convert_arg_to_ellipsis): Handle incomplete type.
2011-03-16 Jason Merrill <jason@redhat.com>
* parser.c (cp_parser_abort_tentative_parse): Make sure we haven't
committed to this tentative parse.
......
......@@ -5671,6 +5671,10 @@ convert_arg_to_ellipsis (tree arg)
arg_type = TREE_TYPE (arg);
if (arg != error_mark_node
/* In a template (or ill-formed code), we can have an incomplete type
even after require_complete_type, in which case we don't know
whether it has trivial copy or not. */
&& COMPLETE_TYPE_P (arg_type)
&& (type_has_nontrivial_copy_init (arg_type)
|| TYPE_HAS_NONTRIVIAL_DESTRUCTOR (arg_type)))
{
......
2011-03-16 Jason Merrill <jason@redhat.com>
* g++.dg/template/incomplete6.C: New.
2011-03-16 Jeff Law <law@redhat.com>
* gcc.dg/tree-ssa/vrp55.c: New test.
......
// PR c++/48115
template<typename> struct templ { };
template<typename T> T declval();
typedef int (*F2)(...);
template<int> struct Int { };
template<typename F, typename T>
struct S
{
template<typename A>
Int<sizeof( declval<F>()(T()) )>
f(A);
};
int main()
{
S<F2, templ<int> >().f(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