Commit 1a7a342d by Jason Merrill

new

From-SVN: r23435
parent 384278dd
// Test for bad loop optimization of goto fixups.
// Special g++ Options: -O2
typedef bool (*ftype) ();
int c, d;
struct A {
A() { ++c; }
A(const A&) { ++c; }
~A() { ++d; }
};
void f (ftype func)
{
A a;
do {
if ((*func)()) return;
} while (true);
}
bool test ()
{
return true;
}
main ()
{
f (test);
return (c != d);
}
// Build don't link:
class A
{
private:
int myInt;
public:
A& operator = (int right) {myInt = right; return *this;}
};
union B
{
char f1;
A f2; // gets bogus error - non-copy assignment op is OK
};
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment