+2011-04-20 Jason Merrill <jason@redhat.com>
+
+ PR c++/48657
+ * decl.c (cp_finish_decl): Handle non-member constant variables
+ in templates, too.
+
2011-04-19 Jason Merrill <jason@redhat.com>
PR c++/46304
then it can be used in future constant expressions, so its value
must be available. */
if (!(init
- && DECL_CLASS_SCOPE_P (decl)
- /* We just set TREE_CONSTANT appropriately; see above. */
- && TREE_CONSTANT (decl)
+ && init_const_expr_p
&& !type_dependent_p
- /* FIXME non-value-dependent constant expression */
+ && decl_maybe_constant_var_p (decl)
&& !value_dependent_init_p (init)))
{
if (init)
goto finish_end;
}
+ if (!DECL_CLASS_SCOPE_P (decl))
+ {
+ tree init_code = check_initializer (decl, init, flags, &cleanup);
+ if (init_code)
+ DECL_INITIAL (decl) = init;
+ goto finish_end;
+ }
+
if (TREE_CODE (init) == TREE_LIST)
{
/* If the parenthesized-initializer form was used (e.g.,
+2011-04-20 Jason Merrill <jason@redhat.com>
+
+ * g++.dg/template/const4.C: New.
+
2011-04-19 Jason Merrill <jason@redhat.com>
* g++.dg/ext/complex7.C: New.