Le Wed, Jan 31, 2007 at 09:42:33AM +0000, Manuel L?pez-Ib??ez écrivait/wrote:
> :ADDPATCH c++:
>
> The error message for this code:
>
> void debug (const char * string)
> {
> return;
> }
>
> int f()
> {
> ( true == false ? 0 : debug ("Some string"));
> return 0;
> }
>
> is:
>
> error: debug(((const char*)"Some string")) has type void and is not a
> throw-expression
>
> The following patch changes the message to:
>
> error: 'debug(((const char*)"Some string"))' of type 'void' is
> incompatible with '0' of type 'int'
I'm not in position to approve patches, but I would suggest that the warning
still talk about throw. Because if debug throwed some exception, the
original code could have some sense.
Maybe it could say
error: 'debug(((const char*)"Some string"))' of type 'void' is
incompatible with '0' of type 'int' and is not a throw-expression
But I don't have enough C++ practice to really know when such an error is
meaningful in the real world.