------- Comment #2 from sebor at roguewave dot com  2008-08-09 22:51 -------
I'm not sure what you're trying to say but it sure looks like a bug to me.
How else is one supposed to throw an exception without triggering this
warning?

Btw., the argument of a throw expression can throw, and when it does, it
becomes the thrown object:

$ cat t.C && g++ -O2 -Wunreachable-code t.C && ./a.out; echo $?
struct S { S () { throw 0; } };
void bar () { throw S (); }

int main ()
{
    try { bar (); }
    catch (int) { return 0; }
    return 1;
}
t.C: In constructor ‘S::S()’:
t.C:1: warning: will never be executed
t.C: In function ‘void bar()’:
t.C:2: warning: will never be executed
0


-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=37070

Reply via email to