[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Bug#184108: ICE when warning about cleanup nastiness in switch statements



Package: g++-3.2
Version: 1:3.2.3-0pre3
Severity: normal

==
aps100@cyclone:~$ cat foo.cpp
#include <iostream>

class foo
{
public: ~foo() { std::cout << "foo destroyed" << std::endl; }
};

int main(void)
{
  switch (0)
    {
    case 0:
      foo x;
    case 1:
      ;
    }
}
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*

-- System Information:
Debian Release: testing/unstable
Architecture: i386
Kernel: Linux cyclone 2.4.21-pre4-ac4 #30 Wed Feb 12 21:40:14 GMT 2003 i686
Locale: LANG=C, LC_CTYPE=C

Versions of packages g++-3.2 depends on:
ii  gcc-3.2                    1:3.2.3-0pre3 The GNU C compiler
ii  gcc-3.2-base               1:3.2.3-0pre3 The GNU Compiler Collection (base 
ii  libc6                      2.3.1-14      GNU C Library: Shared libraries an
ii  libstdc++5-dev             1:3.2.3-0pre3 The GNU Standard C++ Library v3 (d

-- no debconf information


-- 
  .''`.  ** Debian GNU/Linux ** | Andrew Suffield
 : :' :  http://www.debian.org/ | Dept. of Computing,
 `. `'                          | Imperial College,
   `-             -><-          | London, UK

Attachment: pgpNRzx21EpBb.pgp
Description: PGP signature


Reply to: