From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 100377 invoked by alias); 12 May 2015 08:13:28 -0000 Mailing-List: contact gcc-bugs-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Archive: List-Post: List-Help: Sender: gcc-bugs-owner@gcc.gnu.org Received: (qmail 100276 invoked by uid 48); 12 May 2015 08:13:24 -0000 From: "lixin.fnst at cn dot fujitsu.com" To: gcc-bugs@gcc.gnu.org Subject: [Bug c++/59224] [4.7/4.8/4.9 Regression] std::uncaught_exception returns true while constructing exception. Date: Tue, 12 May 2015 08:13:00 -0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: c++ X-Bugzilla-Version: 4.8.1 X-Bugzilla-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: lixin.fnst at cn dot fujitsu.com X-Bugzilla-Status: RESOLVED X-Bugzilla-Resolution: FIXED X-Bugzilla-Priority: P2 X-Bugzilla-Assigned-To: jason at gcc dot gnu.org X-Bugzilla-Target-Milestone: 4.7.4 X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: cc Message-ID: In-Reply-To: References: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: 7bit X-Bugzilla-URL: http://gcc.gnu.org/bugzilla/ Auto-Submitted: auto-generated MIME-Version: 1.0 X-SW-Source: 2015-05/txt/msg00900.txt.bz2 https://gcc.gnu.org/bugzilla/show_bug.cgi?id=59224 li xin changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |lixin.fnst at cn dot fujitsu.com --- Comment #8 from li xin --- (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 #include 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.