Message ID | 20100913223218.GA4152@bromo.med.uc.edu |
---|---|
State | New |
Headers | show |
On Tue, Sep 14, 2010 at 12:32 AM, Jack Howarth <howarth@bromo.med.uc.edu> wrote: > 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 Ok. Thanks, Richard. > 2009-10-02 Jonathan Wakely <redi@gcc.gnu.org> > Jack Howarth <howarth@bromo.med.uc.edu> > > 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<void> (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() ; } > > } ; > >
On 14 Sep 2010, at 11:04, Richard Guenther wrote: > On Tue, Sep 14, 2010 at 12:32 AM, Jack Howarth <howarth@bromo.med.uc.edu > > wrote: >> 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 > > Ok. r164479 Iain
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<void> (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() ; } } ;