This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c++/28943] Unusable error message when using a conditional-expression with multiple type arguments
- From: "pinskia at physics dot uc dot edu" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 3 Sep 2006 20:18:20 -0000
- Subject: [Bug c++/28943] Unusable error message when using a conditional-expression with multiple type arguments
- References: <bug-28943-13189@http.gcc.gnu.org/bugzilla/>
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
------- Comment #5 from pinskia at physics dot uc dot edu 2006-09-03 20:18 -------
Subject: Re: Unusable error message when using a
conditional-expression with multiple type arguments
On Sun, 2006-09-03 at 20:08 +0000, lindevel at gmx dot net wrote:
>
> ------- Comment #4 from lindevel at gmx dot net 2006-09-03 20:08 -------
> You proved ##c++ wrong! They bet that I would be ignored. ;)
>
> The thing is that a void itself is not invalid. Using (expr ? void : void)
> works as you see in my report.
> In ##c++ I was told that ( x ? y : z ) wants both y and z to be of the same
> type. And that is stated in no way by the error message.
void is valid if the both sides of the : are void, otherwise it is
invalid. And they don't have to be the same type either, they can be
different as long as one is convertible to the other (like float and int
or two classes where one is a base class of the other).
-- Pinski
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=28943