This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: rfc: __builtin_syntax_error
- From: "Joseph S. Myers" <jsm28 at cam dot ac dot uk>
- To: Aldy Hernandez <aldyh at redhat dot com>
- Cc: <gcc at gcc dot gnu dot org>
- Date: Mon, 14 Jan 2002 19:08:48 +0000 (GMT)
- Subject: Re: rfc: __builtin_syntax_error
On Mon, 14 Jan 2002, Aldy Hernandez wrote:
> #define some_c_overloaded_fun(a)
> __builtin_choose_expr (__builtin_types_compatible (typeof(a), char),
> something_char(a),
> check for int.... something_int(a)
> check for float.. something_float(a)
> default:
> __builtin_syntax_error("invalid type", __LINE__)
If this is to be a syntax error only when that part of the expression is
chosen, we'll need the support that isn't yet there on the mainline for
suppressing errors in parts of an expression, and make
__builtin_choose_expr use it. I think that the tentative diagnostics
support on cp-parser-branch is sufficient; hopefully after 3.1 branches
the new parser can get merged to the mainline (or, if it isn't ready then,
at least the diagnostics support, which is independently useful for things
like this, can).
--
Joseph S. Myers
jsm28@cam.ac.uk