From patchwork Mon Sep 13 22:32:18 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: Fix PR45645 Date: Mon, 13 Sep 2010 12:32:18 -0000 From: Jack Howarth X-Patchwork-Id: 64662 Message-Id: <20100913223218.GA4152@bromo.med.uc.edu> To: gcc-patches@gcc.gnu.org Cc: paolo.carlini@oracle.com, redi@gcc.gnu.org Currently the g++.dg/torture/pr44972.C is failing on non-Linux targets such as *-*-solaris2* and *-*-darwin* due to the expansion of assert() into the non-portable __assert_fail() call in the testcase. The following patch fixes this by replacing this call with the portable assert(). Tested on x86_64-apple-darwin10 at -m32/-m64. Okay for gcc trunk? Jack 2009-10-02 Jonathan Wakely Jack Howarth PR c++/45645 * g++.dg/torture/pr44972.C: Use portable assert(). Index: gcc/testsuite/g++.dg/torture/pr44972.C =================================================================== --- gcc/testsuite/g++.dg/torture/pr44972.C (revision 164258) +++ gcc/testsuite/g++.dg/torture/pr44972.C (working copy) @@ -74,7 +74,7 @@ T const& get() const ; - T const* operator->() const { ((this->is_initialized()) ? static_cast (0) : __assert_fail ("this->is_initialized()", "pr44972.C", 78, __PRETTY_FUNCTION__)) ; return this->get_ptr_impl() ; } + T const* operator->() const { assert(this->is_initialized()) ; return this->get_ptr_impl() ; } } ;