c++/619: ICE #122 on illegal throw syntax (with if or while)

erik@mail.nu erik@mail.nu
Sat Oct 7 10:26:00 GMT 2000


>Number:         619
>Category:       c++
>Synopsis:       ICE #122 on illegal throw syntax (with if or while)
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    unassigned
>State:          open
>Class:          ice-on-illegal-code
>Submitter-Id:   net
>Arrival-Date:   Sat Oct 07 10:26:00 PDT 2000
>Closed-Date:
>Last-Modified:
>Originator:     Erik Søe Sørensen
>Release:        gcc version 2.96 20000731 (experimental)
>Organization:
>Environment:
Linux 2.2.16-3 i586
>Description:
The ICE occurs when the illegal syntax 'throw Exc;' is used as a *simple*statement* within an if or while construct.
It does not occur, however, when the throw statement is placed in {}s.

Compiler output:
test1.cc: In function `int main ()':
test1.cc:4: parse error before `;'
test1.cc:5: parse error before `;'
test1.cc:6: Internal error #122.
test1.cc:6: Internal compiler error in finish_function, at 
../gcc/cp/decl.c:14409
Please submit a full bug report.
See <URL: http://www.gnu.org/software/gcc/bugs.html > for instructions.
>How-To-Repeat:
struct Exc {};

int main() {
    if (1) {throw Exc;} // This is OK
    if (1) throw Exc;   // This is ICEish
}

>Fix:

>Release-Note:
>Audit-Trail:
>Unformatted:


More information about the Gcc-bugs mailing list