Patchwork Fix PR45645

login
register
mail settings
Submitter Jack Howarth
Date Sept. 13, 2010, 10:32 p.m.
Message ID <20100913223218.GA4152@bromo.med.uc.edu>
Download mbox | patch
Permalink /patch/64662/
State New
Headers show

Comments

Jack Howarth - Sept. 13, 2010, 10:32 p.m.
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  <redi@gcc.gnu.org>
	    Jack Howarth  <howarth@bromo.med.uc.edu>

	PR c++/45645
	* g++.dg/torture/pr44972.C: Use portable assert().
Richard Guenther - Sept. 14, 2010, 10:04 a.m.
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() ; }
>
>  } ;
>
>
IainS - Sept. 21, 2010, 2:13 p.m.
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

Patch

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() ; }
 
 } ;