re PR c++/58614 ([c++11] ICE with undeclared variable in initializer list)

/cp
2015-01-16  Paolo Carlini  <paolo.carlini@oracle.com>

	PR c++/58614
	* pt.c (unify): When BRACE_ENCLOSED_INITIALIZER_P (arg), handle
	TREE_TYPE (elt) == error_mark_node.

/testsuite
2015-01-16  Paolo Carlini  <paolo.carlini@oracle.com>

	PR c++/58614
	* g++.dg/cpp0x/auto44.C: New.

From-SVN: r219716
This commit is contained in:
Paolo Carlini 2015-01-16 09:38:59 +00:00 committed by Paolo Carlini
parent e187264505
commit de37b21e3d
4 changed files with 23 additions and 0 deletions

View File

@ -1,3 +1,9 @@
2015-01-16 Paolo Carlini <paolo.carlini@oracle.com>
PR c++/58614
* pt.c (unify): When BRACE_ENCLOSED_INITIALIZER_P (arg), handle
TREE_TYPE (elt) == error_mark_node.
2015-01-15 Jan Hubicka <hubicka@ucw.cz>
PR tree-optimization/62053

View File

@ -17875,6 +17875,8 @@ unify (tree tparms, tree targs, tree parm, tree arg, int strict,
if (!BRACE_ENCLOSED_INITIALIZER_P (elt))
{
tree type = TREE_TYPE (elt);
if (type == error_mark_node)
return unify_invalid (explain_p);
/* It should only be possible to get here for a call. */
gcc_assert (elt_strict & UNIFY_ALLOW_OUTER_LEVEL);
elt_strict |= maybe_adjust_types_for_deduction

View File

@ -1,3 +1,8 @@
2015-01-16 Paolo Carlini <paolo.carlini@oracle.com>
PR c++/58614
* g++.dg/cpp0x/auto44.C: New.
2015-01-15 Sandra Loosemore <sandra@codesourcery.com>
PR target/59710

View File

@ -0,0 +1,10 @@
// PR c++/58614
// { dg-do compile { target c++11 } }
#include <initializer_list>
void foo()
{
i; // { dg-error "not declared" }
auto j = { i }; // { dg-error "unable to deduce" }
}