This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c++/13239] [3.3 REGRESSION] Assertion does not seem to work correctly anymore
- From: "rmerkert at alphatech dot com" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 2 Dec 2003 22:32:27 -0000
- Subject: [Bug c++/13239] [3.3 REGRESSION] Assertion does not seem to work correctly anymore
- References: <20031130163447.13239.rmerkert@alphatech.com>
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
------- Additional Comments From rmerkert at alphatech dot com 2003-12-02 22:32 -------
Here's another, slightly simplified, example:
#include <assert.h>
struct Y {
Y () : _y(0) {}
//Y (const Y& y) : _y(y._y) {}
int _y;
};
bool foo() { return true; }
Y bar() { return Y(); }
int main()
{
assert (bar()._y==0);
assert ( foo() && (bar()._y)==0 );
return 0;
}
If the copy constructor is uncommented, then it works. It almost looks as if it
does not generate the temporary Y object and just pretends it has got it. I've
tried this on a solaris and it worked and I also tried it on a cygwin (3.1 ?
maybe) which worked as well.
Can someone verify that their system is using builtin_expect rather than general
assert?
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=13239