Commit 5453bbef by Jason Merrill Committed by Jason Merrill

re PR c++/48265 ([C++0x] ICE: SIGSEGV (recursion in…

re PR c++/48265 ([C++0x] ICE: SIGSEGV (recursion in value_dependent_expression_p) when variable is used uninitialised)

	PR c++/48265
	* pt.c (value_dependent_expression_p) [VAR_DECL]: Make sure
	the variable is constant before looking at its initializer.

From-SVN: r171714
parent ad3b266b
2011-03-29 Jason Merrill <jason@redhat.com>
PR c++/48265
* pt.c (value_dependent_expression_p) [VAR_DECL]: Make sure
the variable is constant before looking at its initializer.
PR c++/48319
* pt.c (value_dependent_expression_p): Handle TEMPLATE_ID_EXPR.
......
......@@ -18085,10 +18085,10 @@ value_dependent_expression_p (tree expression)
return value_dependent_expression_p (DECL_INITIAL (expression));
case VAR_DECL:
/* A constant with integral or enumeration type and is initialized
/* A constant with literal type and is initialized
with an expression that is value-dependent. */
if (DECL_INITIAL (expression)
&& INTEGRAL_OR_ENUMERATION_TYPE_P (TREE_TYPE (expression))
&& decl_constant_var_p (expression)
&& value_dependent_expression_p (DECL_INITIAL (expression)))
return true;
return false;
......
2011-03-29 Jason Merrill <jason@redhat.com>
* g++.dg/cpp0x/regress/value-dep1.C: New.
2011-03-29 Steve Ellcey <sje@cup.hp.com>
* gcc.dg/torture/pr47917.c: Use -std=gnu99 on HP-UX.
......
// PR c++/48265
// { dg-options -std=c++0x }
template < int > struct S
{
S () { const int i = i; i; };
};
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