This is the mail archive of the gcc-bugs@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]

[Bug c++/28943] Unusable error message when using a conditional-expression with multiple type arguments



------- 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


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