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
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.
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.
--- /dev/null
+// PR c++/48265
+// { dg-options -std=c++0x }
+
+template < int > struct S
+{
+ S () { const int i = i; i; };
+};