* [Bug c++/59224] [4.7/4.8/4.9 Regression] std::uncaught_exception returns true while constructing exception.
2013-11-21 2:48 [Bug c++/59224] New: std::uncaught_exception always returns true after exception while constructing another exception man2gm at gmail dot com
@ 2013-11-21 14:02 ` redi at gcc dot gnu.org
2013-11-21 14:11 ` redi at gcc dot gnu.org
` (11 subsequent siblings)
12 siblings, 0 replies; 14+ messages in thread
From: redi at gcc dot gnu.org @ 2013-11-21 14:02 UTC (permalink / raw)
To: gcc-bugs
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=59224
Jonathan Wakely <redi at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Status|UNCONFIRMED |NEW
Last reconfirmed| |2013-11-21
Known to work| |4.5.1
Summary|std::uncaught_exception |[4.7/4.8/4.9 Regression]
|always returns true after |std::uncaught_exception
|exception while |returns true while
|constructing another |constructing exception.
|exception. |
Ever confirmed|0 |1
Known to fail| |4.6.0, 4.7.4, 4.8.2, 4.9.0
--- Comment #1 from Jonathan Wakely <redi at gcc dot gnu.org> ---
Confirmed. uncaught_exception becomes true while evaluating the operand of the
throw statement, but should only be true after initialization of the exception
object is complete.
#include <exception>
int f()
{
if (std::uncaught_exception())
std::terminate();
return 1;
}
int main()
{
try
{
throw f();
}
catch (...)
{
}
}
^ permalink raw reply [flat|nested] 14+ messages in thread
* [Bug c++/59224] [4.7/4.8/4.9 Regression] std::uncaught_exception returns true while constructing exception.
2013-11-21 2:48 [Bug c++/59224] New: std::uncaught_exception always returns true after exception while constructing another exception man2gm at gmail dot com
2013-11-21 14:02 ` [Bug c++/59224] [4.7/4.8/4.9 Regression] std::uncaught_exception returns true while constructing exception redi at gcc dot gnu.org
@ 2013-11-21 14:11 ` redi at gcc dot gnu.org
2013-12-19 15:20 ` rguenth at gcc dot gnu.org
` (10 subsequent siblings)
12 siblings, 0 replies; 14+ messages in thread
From: redi at gcc dot gnu.org @ 2013-11-21 14:11 UTC (permalink / raw)
To: gcc-bugs
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=59224
--- Comment #2 from Jonathan Wakely <redi at gcc dot gnu.org> ---
Possibly a dup of PR 41174 (although that was wrong prior to 4.6.0)
^ permalink raw reply [flat|nested] 14+ messages in thread
* [Bug c++/59224] [4.7/4.8/4.9 Regression] std::uncaught_exception returns true while constructing exception.
2013-11-21 2:48 [Bug c++/59224] New: std::uncaught_exception always returns true after exception while constructing another exception man2gm at gmail dot com
2013-11-21 14:02 ` [Bug c++/59224] [4.7/4.8/4.9 Regression] std::uncaught_exception returns true while constructing exception redi at gcc dot gnu.org
2013-11-21 14:11 ` redi at gcc dot gnu.org
@ 2013-12-19 15:20 ` rguenth at gcc dot gnu.org
2013-12-19 15:34 ` rguenth at gcc dot gnu.org
` (9 subsequent siblings)
12 siblings, 0 replies; 14+ messages in thread
From: rguenth at gcc dot gnu.org @ 2013-12-19 15:20 UTC (permalink / raw)
To: gcc-bugs
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=59224
Richard Biener <rguenth at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Target Milestone|--- |4.7.4
^ permalink raw reply [flat|nested] 14+ messages in thread
* [Bug c++/59224] [4.7/4.8/4.9 Regression] std::uncaught_exception returns true while constructing exception.
2013-11-21 2:48 [Bug c++/59224] New: std::uncaught_exception always returns true after exception while constructing another exception man2gm at gmail dot com
` (2 preceding siblings ...)
2013-12-19 15:20 ` rguenth at gcc dot gnu.org
@ 2013-12-19 15:34 ` rguenth at gcc dot gnu.org
2014-01-24 19:07 ` jason at gcc dot gnu.org
` (8 subsequent siblings)
12 siblings, 0 replies; 14+ messages in thread
From: rguenth at gcc dot gnu.org @ 2013-12-19 15:34 UTC (permalink / raw)
To: gcc-bugs
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=59224
Richard Biener <rguenth at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Priority|P3 |P2
^ permalink raw reply [flat|nested] 14+ messages in thread
* [Bug c++/59224] [4.7/4.8/4.9 Regression] std::uncaught_exception returns true while constructing exception.
2013-11-21 2:48 [Bug c++/59224] New: std::uncaught_exception always returns true after exception while constructing another exception man2gm at gmail dot com
` (3 preceding siblings ...)
2013-12-19 15:34 ` rguenth at gcc dot gnu.org
@ 2014-01-24 19:07 ` jason at gcc dot gnu.org
2014-01-27 13:58 ` jason at gcc dot gnu.org
` (7 subsequent siblings)
12 siblings, 0 replies; 14+ messages in thread
From: jason at gcc dot gnu.org @ 2014-01-24 19:07 UTC (permalink / raw)
To: gcc-bugs
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=59224
Jason Merrill <jason at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Status|NEW |ASSIGNED
CC| |jason at gcc dot gnu.org
Assignee|unassigned at gcc dot gnu.org |jason at gcc dot gnu.org
^ permalink raw reply [flat|nested] 14+ messages in thread
* [Bug c++/59224] [4.7/4.8/4.9 Regression] std::uncaught_exception returns true while constructing exception.
2013-11-21 2:48 [Bug c++/59224] New: std::uncaught_exception always returns true after exception while constructing another exception man2gm at gmail dot com
` (4 preceding siblings ...)
2014-01-24 19:07 ` jason at gcc dot gnu.org
@ 2014-01-27 13:58 ` jason at gcc dot gnu.org
2014-01-27 13:59 ` jason at gcc dot gnu.org
` (6 subsequent siblings)
12 siblings, 0 replies; 14+ messages in thread
From: jason at gcc dot gnu.org @ 2014-01-27 13:58 UTC (permalink / raw)
To: gcc-bugs
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=59224
--- Comment #3 from Jason Merrill <jason at gcc dot gnu.org> ---
Author: jason
Date: Mon Jan 27 13:57:39 2014
New Revision: 207129
URL: http://gcc.gnu.org/viewcvs?rev=207129&root=gcc&view=rev
Log:
Core DR 475
PR c++/41174
PR c++/59224
* libsupc++/eh_throw.cc (__cxa_throw): Set uncaughtExceptions.
* libsupc++/eh_alloc.cc (__cxa_allocate_dependent_exception)
(__cxa_allocate_exception): Don't set it here.
Added:
trunk/gcc/testsuite/g++.dg/eh/uncaught4.C
Modified:
trunk/gcc/testsuite/g++.dg/eh/uncaught1.C
trunk/libstdc++-v3/ChangeLog
trunk/libstdc++-v3/libsupc++/eh_alloc.cc
trunk/libstdc++-v3/libsupc++/eh_throw.cc
^ permalink raw reply [flat|nested] 14+ messages in thread
* [Bug c++/59224] [4.7/4.8/4.9 Regression] std::uncaught_exception returns true while constructing exception.
2013-11-21 2:48 [Bug c++/59224] New: std::uncaught_exception always returns true after exception while constructing another exception man2gm at gmail dot com
` (5 preceding siblings ...)
2014-01-27 13:58 ` jason at gcc dot gnu.org
@ 2014-01-27 13:59 ` jason at gcc dot gnu.org
2014-01-27 14:03 ` jason at gcc dot gnu.org
` (5 subsequent siblings)
12 siblings, 0 replies; 14+ messages in thread
From: jason at gcc dot gnu.org @ 2014-01-27 13:59 UTC (permalink / raw)
To: gcc-bugs
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=59224
--- Comment #4 from Jason Merrill <jason at gcc dot gnu.org> ---
Author: jason
Date: Mon Jan 27 13:58:48 2014
New Revision: 207131
URL: http://gcc.gnu.org/viewcvs?rev=207131&root=gcc&view=rev
Log:
Core DR 475
PR c++/41174
PR c++/59224
* libsupc++/eh_throw.cc (__cxa_throw): Set uncaughtExceptions.
* libsupc++/eh_alloc.cc (__cxa_allocate_dependent_exception)
(__cxa_allocate_exception): Don't set it here.
Added:
branches/gcc-4_8-branch/gcc/testsuite/g++.dg/eh/uncaught4.C
Modified:
branches/gcc-4_8-branch/gcc/testsuite/g++.dg/eh/uncaught1.C
branches/gcc-4_8-branch/libstdc++-v3/ChangeLog
branches/gcc-4_8-branch/libstdc++-v3/libsupc++/eh_alloc.cc
branches/gcc-4_8-branch/libstdc++-v3/libsupc++/eh_throw.cc
^ permalink raw reply [flat|nested] 14+ messages in thread
* [Bug c++/59224] [4.7/4.8/4.9 Regression] std::uncaught_exception returns true while constructing exception.
2013-11-21 2:48 [Bug c++/59224] New: std::uncaught_exception always returns true after exception while constructing another exception man2gm at gmail dot com
` (6 preceding siblings ...)
2014-01-27 13:59 ` jason at gcc dot gnu.org
@ 2014-01-27 14:03 ` jason at gcc dot gnu.org
2014-01-27 14:03 ` jason at gcc dot gnu.org
` (4 subsequent siblings)
12 siblings, 0 replies; 14+ messages in thread
From: jason at gcc dot gnu.org @ 2014-01-27 14:03 UTC (permalink / raw)
To: gcc-bugs
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=59224
Jason Merrill <jason at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Status|ASSIGNED |RESOLVED
Resolution|--- |FIXED
Target Milestone|4.7.4 |4.8.3
--- Comment #5 from Jason Merrill <jason at gcc dot gnu.org> ---
Fixed for 4.8.3/4.9. Not fixing on 4.7 branch.
^ permalink raw reply [flat|nested] 14+ messages in thread
* [Bug c++/59224] [4.7/4.8/4.9 Regression] std::uncaught_exception returns true while constructing exception.
2013-11-21 2:48 [Bug c++/59224] New: std::uncaught_exception always returns true after exception while constructing another exception man2gm at gmail dot com
` (7 preceding siblings ...)
2014-01-27 14:03 ` jason at gcc dot gnu.org
@ 2014-01-27 14:03 ` jason at gcc dot gnu.org
2014-04-01 17:29 ` jason at gcc dot gnu.org
` (3 subsequent siblings)
12 siblings, 0 replies; 14+ messages in thread
From: jason at gcc dot gnu.org @ 2014-01-27 14:03 UTC (permalink / raw)
To: gcc-bugs
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=59224
Bug 59224 depends on bug 41174, which changed state.
Bug 41174 Summary: uncaught_exception always returns true
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=41174
What |Removed |Added
----------------------------------------------------------------------------
Status|ASSIGNED |RESOLVED
Resolution|--- |FIXED
^ permalink raw reply [flat|nested] 14+ messages in thread
* [Bug c++/59224] [4.7/4.8/4.9 Regression] std::uncaught_exception returns true while constructing exception.
2013-11-21 2:48 [Bug c++/59224] New: std::uncaught_exception always returns true after exception while constructing another exception man2gm at gmail dot com
` (8 preceding siblings ...)
2014-01-27 14:03 ` jason at gcc dot gnu.org
@ 2014-04-01 17:29 ` jason at gcc dot gnu.org
2014-04-01 17:30 ` jason at gcc dot gnu.org
` (2 subsequent siblings)
12 siblings, 0 replies; 14+ messages in thread
From: jason at gcc dot gnu.org @ 2014-04-01 17:29 UTC (permalink / raw)
To: gcc-bugs
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=59224
--- Comment #6 from Jason Merrill <jason at gcc dot gnu.org> ---
Author: jason
Date: Tue Apr 1 17:28:29 2014
New Revision: 208991
URL: http://gcc.gnu.org/viewcvs?rev=208991&root=gcc&view=rev
Log:
Core DR 475
PR c++/41174
PR c++/59224
* libsupc++/eh_throw.cc (__cxa_throw): Set uncaughtExceptions.
* libsupc++/eh_alloc.cc (__cxa_allocate_dependent_exception)
(__cxa_allocate_exception): Don't set it here.
Added:
branches/gcc-4_7-branch/gcc/testsuite/g++.dg/eh/uncaught4.C
Modified:
branches/gcc-4_7-branch/gcc/testsuite/g++.dg/eh/uncaught1.C
branches/gcc-4_7-branch/libstdc++-v3/ChangeLog
branches/gcc-4_7-branch/libstdc++-v3/libsupc++/eh_alloc.cc
branches/gcc-4_7-branch/libstdc++-v3/libsupc++/eh_throw.cc
^ permalink raw reply [flat|nested] 14+ messages in thread
* [Bug c++/59224] [4.7/4.8/4.9 Regression] std::uncaught_exception returns true while constructing exception.
2013-11-21 2:48 [Bug c++/59224] New: std::uncaught_exception always returns true after exception while constructing another exception man2gm at gmail dot com
` (9 preceding siblings ...)
2014-04-01 17:29 ` jason at gcc dot gnu.org
@ 2014-04-01 17:30 ` jason at gcc dot gnu.org
2015-05-12 8:13 ` lixin.fnst at cn dot fujitsu.com
2015-05-12 10:55 ` redi at gcc dot gnu.org
12 siblings, 0 replies; 14+ messages in thread
From: jason at gcc dot gnu.org @ 2014-04-01 17:30 UTC (permalink / raw)
To: gcc-bugs
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=59224
Jason Merrill <jason at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Target Milestone|4.8.3 |4.7.4
--- Comment #7 from Jason Merrill <jason at gcc dot gnu.org> ---
OK, fixed for 4.7.4 as well.
^ permalink raw reply [flat|nested] 14+ messages in thread
* [Bug c++/59224] [4.7/4.8/4.9 Regression] std::uncaught_exception returns true while constructing exception.
2013-11-21 2:48 [Bug c++/59224] New: std::uncaught_exception always returns true after exception while constructing another exception man2gm at gmail dot com
` (10 preceding siblings ...)
2014-04-01 17:30 ` jason at gcc dot gnu.org
@ 2015-05-12 8:13 ` lixin.fnst at cn dot fujitsu.com
2015-05-12 10:55 ` redi at gcc dot gnu.org
12 siblings, 0 replies; 14+ messages in thread
From: lixin.fnst at cn dot fujitsu.com @ 2015-05-12 8:13 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=59224
li xin <lixin.fnst at cn dot fujitsu.com> changed:
What |Removed |Added
----------------------------------------------------------------------------
CC| |lixin.fnst at cn dot fujitsu.com
--- Comment #8 from li xin <lixin.fnst at cn dot fujitsu.com> ---
(In reply to Jason Merrill from comment #5)
> Fixed for 4.8.3/4.9. Not fixing on 4.7 branch.
It will lead to the lsb test caes
/libstdcxx-t2c/tests/LanguageSupport/LanguageSupport FAIL.
So I want to know the right return value of std::uncaught_exception() (inside
exception-constructor).
The LSB test code is as follows:
cat main.cpp
#include <string.h>
#include <iostream>
using namespace std;
class exception_test : public exception
{
public:
bool result;
exception_test(): exception(){result = uncaught_exception();}
~exception_test() throw(){};
};
int main(int argc, char ** argv)
{
bool result;
try
{
throw exception_test();
}
catch(exception_test et)
{
result = et.result;
}
cerr << result << endl;
return 0;
}
# g++ ./main.cpp
# ./a.out
0
My GCC version is 4.9.2, the return value of result is 0,and the test is FAIL.
If the the return value of result is 1,and the test will be PASS.
^ permalink raw reply [flat|nested] 14+ messages in thread
* [Bug c++/59224] [4.7/4.8/4.9 Regression] std::uncaught_exception returns true while constructing exception.
2013-11-21 2:48 [Bug c++/59224] New: std::uncaught_exception always returns true after exception while constructing another exception man2gm at gmail dot com
` (11 preceding siblings ...)
2015-05-12 8:13 ` lixin.fnst at cn dot fujitsu.com
@ 2015-05-12 10:55 ` redi at gcc dot gnu.org
12 siblings, 0 replies; 14+ messages in thread
From: redi at gcc dot gnu.org @ 2015-05-12 10:55 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=59224
--- Comment #9 from Jonathan Wakely <redi at gcc dot gnu.org> ---
(In reply to li xin from comment #8)
> It will lead to the lsb test caes
> /libstdcxx-t2c/tests/LanguageSupport/LanguageSupport FAIL.
> So I want to know the right return value of std::uncaught_exception()
> (inside exception-constructor).
What isn't clear about the bug report? The right value is the one G++ gives
now.
The LSB test is wrong.
^ permalink raw reply [flat|nested] 14+ messages in thread