rfc: __builtin_syntax_error
Joseph S. Myers
jsm28@cam.ac.uk
Mon Jan 14 11:31:00 GMT 2002
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
More information about the Gcc
mailing list