Bug#184108: ICE when warning about cleanup nastiness in switch statements
retitle 184108 [fixed in 3.3] ICE when warning about cleanup nastiness in switch statements
thanks
Andrew Suffield writes:
> aps100@cyclone:~$ g++ -ofoo foo.cpp
> foo.cpp: In function `int main()':
> foo.cpp:14: jump to case label
> foo.cpp:13: enters scope of non-POD `foo x'
>
> Internal compiler error: Error reporting routines re-entered.
> Please submit a full bug report,
> with preprocessed source if appropriate.
> See <URL:http://www.gnu.org/software/gcc/bugs.html> for instructions.
> ==
>
> This comes from genrtl_case_label(), which is trying to do this:
> warning_with_decl (TREE_PURPOSE (cleanup),
> "destructor needed for `%#D'");
>
> Unfortunately that string winds up in format_with_decl(), which does
> this:
>
> /* Do magic to get around lack of varargs support for insertion
> of arguments into existing list. We know that the decl is first;
> we ass_u_me that it will be printed with "%s". */
> ...
> else if (*(p + 1) != 's')
> abort ();
>
> The fix could go either way. One of them involves updating all the
> translations. *punt*
$ /usr/lib/gcc-snapshot/bin/g++ bug-184108.cc
bug-184108.cc: In function `int main()':
bug-184108.cc:14: error: jump to case label
bug-184108.cc:13: error: enters scope of non-POD `foo x'
bug-184108.cc:14: warning: destructor needed for `foo x'
bug-184108.cc:14: warning: where case label appears here
bug-184108.cc:14: warning: (enclose actions of previous case statements
requiring destructors in their own scope.)
Reply to: