OSDN Git Service

(struct function): Make frame_offset be HOST_WIDE_INT.
[pf3gnuchains/gcc-fork.git] / gcc / cp / typeck2.c
index c224892..1c00297 100644 (file)
@@ -302,7 +302,7 @@ ack (s, v, v2)
    silly.  So instead, we just do the equivalent of a call to fatal in the
    same situation (call exit).  */
 
-/* First used: 0 (reserved), Last used: 366.  Free: */
+/* First used: 0 (reserved), Last used: 367.  Free: */
 
 static int abortcount = 0;
 
@@ -607,6 +607,10 @@ store_init_value (decl, init)
        }
     }
 
+  if (TYPE_PTRMEMFUNC_P (type) && TREE_CODE (init) == CONSTRUCTOR
+      && TREE_TYPE (init) == NULL_TREE)
+    cp_pedwarn ("initializer list for `%T'", type);
+
   /* End of special C++ code.  */
 
   /* Digest the specified initializer into an expression.  */
@@ -825,7 +829,9 @@ digest_init (type, init, tail)
            }
          init = element;
        }
-      while (TREE_CODE (init) == CONSTRUCTOR)
+      while (TREE_CODE (init) == CONSTRUCTOR
+            && ! (TREE_TYPE (init)
+                  && TYPE_PTRMEMFUNC_P (TREE_TYPE (init))))
        {
          cp_pedwarn ("braces around scalar initializer for `%T'", type);
          init = CONSTRUCTOR_ELTS (init);
@@ -875,12 +881,7 @@ digest_init (type, init, tail)
          *tail = old_tail_contents;
          return process_init_constructor (type, 0, tail);
        }
-      else if (flag_traditional)
-       /* Traditionally one can say `char x[100] = 0;'.  */
-       return process_init_constructor (type,
-                                        build_nt (CONSTRUCTOR, NULL_TREE,
-                                                  tree_cons (NULL_TREE, init, NULL_TREE)),
-                                        (tree*)0);
+
       if (code != ARRAY_TYPE)
        return convert_for_initialization (NULL_TREE, type, init, LOOKUP_NORMAL,
                                           "initialization", NULL_TREE, 0);
@@ -1011,9 +1012,6 @@ process_init_constructor (type, init, elts)
              sorry ("initializer list for object using virtual functions");
              return error_mark_node;
            }
-
-         if (TYPE_PTRMEMFUNC_P (type))
-           cp_pedwarn ("initializer list for `%T'", type);
        }
 
       for (field = TYPE_FIELDS (type); field && tail;
@@ -1091,7 +1089,8 @@ process_init_constructor (type, init, elts)
 
       /* Find the first named field.  ANSI decided in September 1990
         that only named fields count here.  */
-      while (field && DECL_NAME (field) == 0)
+      while (field && (DECL_NAME (field) == 0
+                      || TREE_CODE (field) != FIELD_DECL))
        field = TREE_CHAIN (field);
 
       /* If this element specifies a field, initialize via that field.  */
@@ -1261,7 +1260,7 @@ build_x_arrow (datum)
   if (type == error_mark_node)
     return error_mark_node;
 
-  if (current_template_parms)
+  if (processing_template_decl)
     return build_min_nt (ARROW_EXPR, rval);
 
   if (TREE_CODE (rval) == OFFSET_REF)
@@ -1337,7 +1336,7 @@ build_m_component_ref (datum, component)
   tree rettype;
   tree binfo;
 
-  if (current_template_parms)
+  if (processing_template_decl)
     return build_min_nt (DOTSTAR_EXPR, datum, component);
 
   if (TYPE_PTRMEMFUNC_P (TREE_TYPE (component)))
@@ -1422,7 +1421,7 @@ build_functional_cast (exp, parms)
   else
     type = exp;
 
-  if (current_template_parms)
+  if (processing_template_decl)
     return build_min (CAST_EXPR, type, parms);
 
   if (IS_SIGNATURE (type))