OSDN Git Service

Daily bump.
[pf3gnuchains/gcc-fork.git] / gcc / cp / init.c
index d68dd2d..61c78e1 100644 (file)
@@ -1659,6 +1659,15 @@ constant_value_1 (tree decl, bool integral_p)
        }
       if (init == error_mark_node)
        return decl;
+      /* Initializers in templates are generally expanded during
+        instantiation, so before that for const int i(2)
+        INIT is a TREE_LIST with the actual initializer as
+        TREE_VALUE.  */
+      if (processing_template_decl
+         && init
+         && TREE_CODE (init) == TREE_LIST
+         && TREE_CHAIN (init) == NULL_TREE)
+       init = TREE_VALUE (init);
       if (!init
          || !TREE_TYPE (init)
          || (integral_p