Commit a3f7c896 by Jakub Jelinek Committed by Jakub Jelinek

re PR c++/78649 (ICE on invalid C++ code on x86_64-linux-gnu (internal compiler…

re PR c++/78649 (ICE on invalid C++ code on x86_64-linux-gnu (internal compiler error: tree check: expected class ‘type’, have ‘exceptional’ (error_mark) in build_value_init_noctor, at cp/init.c:380))

	PR c++/78649
	* pt.c (tsubst_init): Don't call build_value_init if decl's type
	is error_mark_node.

	* g++.dg/cpp0x/pr78649.C: New test.

From-SVN: r243204
parent 81cff75f
2016-12-02 Jakub Jelinek <jakub@redhat.com>
PR c++/78649
* pt.c (tsubst_init): Don't call build_value_init if decl's type
is error_mark_node.
2016-12-02 Cesar Philippidis <cesar@codesourcery.com> 2016-12-02 Cesar Philippidis <cesar@codesourcery.com>
James Norris <jnorris@codesourcery.com> James Norris <jnorris@codesourcery.com>
......
...@@ -14082,7 +14082,7 @@ tsubst_init (tree init, tree decl, tree args, ...@@ -14082,7 +14082,7 @@ tsubst_init (tree init, tree decl, tree args,
init = tsubst_expr (init, args, complain, in_decl, false); init = tsubst_expr (init, args, complain, in_decl, false);
if (!init) if (!init && TREE_TYPE (decl) != error_mark_node)
{ {
/* If we had an initializer but it /* If we had an initializer but it
instantiated to nothing, instantiated to nothing,
......
2016-12-02 Jakub Jelinek <jakub@redhat.com>
PR c++/78649
* g++.dg/cpp0x/pr78649.C: New test.
2016-12-02 Uros Bizjak <ubizjak@gmail.com> 2016-12-02 Uros Bizjak <ubizjak@gmail.com>
PR target/70322 PR target/70322
......
// PR c++/78649
// { dg-do compile { target c++11 } }
template <class> void foo ();
template <class T, class... U>
void
test ()
{
T t (foo<U>...); // { dg-error "declared void" }
}
int
main ()
{
test<void> ();
}
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