------- Additional Comments From loki at inf dot u-szeged dot hu 2004-10-28 06:42 ------- (In reply to comment #7) > > Surely this is not valid? > > The validity is the subject of bug 772 and the long thread linked from > there. This bug is for a particular ICE which is a regression; whether > the code is valid or invalid depends on whether any resolution suggested > in bug 772 or elsewhere is adopted.
Yes. I agree with you. This is a regression in ?: operator evaluation. I didn't want to change anything about bug 772. [...] > First, you need to check for switch statements > jumping into the statement expression. Second, if inside a statement > expression you encounter a reference to an undeclared label, you don't > know whether it refers to one later within that statement expression or > one outside in the function (and in an address-of-label context, both > could reasonably be valid) so don't know in what scope to declare the > label (or, if there's one outside already seen with that name, whether the > new one is a reference to that label or to a new local one). For that > reason I think it's best to keep the current scoping rules and have a > separate check for any form of jumps into statement expressions, with > jumps by computed goto explicitly runtime undefined. (While jumps in from > longjmp might be OK.) Yes, you are right. I missed some cases. I'm working on it... -- http://gcc.gnu.org/bugzilla/show_bug.cgi?id=17913