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]

Re: c++/8186: ICE in cp_expr_size, at cp/cp-lang.c:304


Hi,

the PR can be reduced to the following code snippet:

----------------------snip here--------------------
#include<string>

struct C
{
    C (std::string) {}
};

void foo ()
{
    throw C(std::string());
}
----------------------snip here--------------------

This can be further reduced to:

----------------------snip here--------------------
struct A
{
    A ();
    A (const A&);
};

struct B
{
    A a;
    B& operator= (const B&);
};

struct C
{
    C (B) {}
};

void foo ()
{
    throw C(B());
}
----------------------snip here--------------------

Compiling with "g++ -O -c" the main trunk (as of 20021007) crashes
with the message (checked on i686-pc-linux-gnu and mips-sgi-irix6.5):

bug.cc: In function `void foo()':
bug.cc:15: internal compiler error: in cp_expr_size, at cp/cp-lang.c:304
Please submit a full bug report, [etc.]

The 3.2-branch and previous versions are not affected.

Greetings,
Volker Reichelt

http://gcc.gnu.org/cgi-bin/gnatsweb.pl?cmd=view%20audit-trail&database=gcc&pr=8186



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