This is the mail archive of the gcc@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]