This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [C++ Patch/RFC] PR 55951
- From: Jason Merrill <jason at redhat dot com>
- To: Paolo Carlini <paolo dot carlini at oracle dot com>
- Cc: "gcc-patches at gcc dot gnu dot org" <gcc-patches at gcc dot gnu dot org>
- Date: Tue, 26 Mar 2013 10:14:37 -0400
- Subject: Re: [C++ Patch/RFC] PR 55951
- References: <51519007 dot 9010708 at oracle dot com> <51519560 dot 8080306 at redhat dot com> <51519FF8 dot 7040500 at oracle dot com>
On 03/26/2013 09:17 AM, Paolo Carlini wrote:
+ if (identifier_p (ce->index))
+ {
+ error ("name %qD used in a GNU-style designated "
+ "initializer for an array", ce->index);
+ return false;
+ }
+
+ tree ce_index = cxx_constant_value (ce->index);
+
/* The parser only allows identifiers as designated
initializers. */
if (ce->index == error_mark_node)
error ("name used in a GNU-style designated "
"initializer for an array");
Let's also combine these two instances of the same error.
Jason