@@ -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;
new file mode 100644
@@ -0,0 +1,7 @@
+// PR c++/48265
+// { dg-options -std=c++0x }
+
+template < int > struct S
+{
+ S () { const int i = i; i; };
+};