* varasm.c (initializer_constant_valid_p): Allow a conversion from
an integral constant to an OFFSET_TYPE.
PR c++/12696
* decl.c (reshape_init): Recover quickly from errors.
PR c++/12218
* g++.dg/init/pm3.C: New test.
PR c++/12696
* g++.dg/init/error1.C: New test.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@74731
138bc75d-0d04-0410-961f-
82ee72b054a4
+2003-12-16 Mark Mitchell <mark@codesourcery.com>
+
+ PR c++/12218
+ * varasm.c (initializer_constant_valid_p): Allow a conversion from
+ an integral constant to an OFFSET_TYPE.
+
2003-12-16 Kazu Hirata <kazu@cs.umass.edu>
PR target/11012
+2003-12-16 Mark Mitchell <mark@codesourcery.com>
+
+ PR c++/12696
+ * decl.c (reshape_init): Recover quickly from errors.
+
2003-12-16 Nathan Sidwell <nathan@codesourcery.com>
PR c++/9043
2003-12-16 Mark Mitchell <mark@codesourcery.com>
+ PR c++/12696
+ * decl.c (reshape_init): Recover quickly from errors.
+
PR c++/13275
* lex.c (reswords): Add "__offsetof" and "__offsetof__".
* parser.c (cp_parser): Add in_offsetof_p.
empty class shall have the form of an empty
initializer-list {}. */
if (!brace_enclosed_p)
- error ("initializer for `%T' must be brace-enclosed",
- type);
+ {
+ error ("initializer for `%T' must be brace-enclosed",
+ type);
+ return error_mark_node;
+ }
}
else
{
break;
field_init = reshape_init (TREE_TYPE (field), initp);
+ if (field_init == error_mark_node)
+ return error_mark_node;
TREE_CHAIN (field_init) = CONSTRUCTOR_ELTS (new_init);
CONSTRUCTOR_ELTS (new_init) = field_init;
/* [dcl.init.aggr]
tree element_init;
element_init = reshape_init (TREE_TYPE (type), initp);
+ if (element_init == error_mark_node)
+ return error_mark_node;
TREE_CHAIN (element_init) = CONSTRUCTOR_ELTS (new_init);
CONSTRUCTOR_ELTS (new_init) = element_init;
if (TREE_PURPOSE (element_init))
+2003-12-16 Mark Mitchell <mark@codesourcery.com>
+
+ PR c++/12696
+ * g++.dg/init/error1.C: New test.
+
+ PR c++/12218
+ * g++.dg/init/pm3.C: New test.
+
2003-12-17 Joseph S. Myers <jsm@polyomino.org.uk>
PR c/3347
--- /dev/null
+// PR c++/12696
+
+struct A {
+ static float b[10]; // { dg-error "" }
+}
+
+float A::b[] = {1,2,3}; // { dg-error "" }
--- /dev/null
+// PR c++/12218
+// { dg-do run }
+
+struct C { int i, j; };
+typedef int C::*mPtr;
+extern const mPtr should_be_0 = &C::i;
+extern const mPtr should_be_4 = &C::j;
+
+int main () {
+}
/* Likewise conversions from int to pointers, but also allow
conversions from 0. */
- if (POINTER_TYPE_P (TREE_TYPE (value))
+ if ((POINTER_TYPE_P (TREE_TYPE (value))
+ || TREE_CODE (TREE_TYPE (value)) == OFFSET_TYPE)
&& INTEGRAL_TYPE_P (TREE_TYPE (TREE_OPERAND (value, 0))))
{
if (integer_zerop (TREE_OPERAND (value, 0)))