[Bug c++/68948] G++ voluntarily removes a function call with terrible side effects
pinskia at gcc dot gnu.org
gcc-bugzilla@gcc.gnu.org
Thu Dec 17 23:09:00 GMT 2015
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=68948
Andrew Pinski <pinskia at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Status|UNCONFIRMED |NEW
Last reconfirmed| |2015-12-17
Ever confirmed|0 |1
--- Comment #7 from Andrew Pinski <pinskia at gcc dot gnu.org> ---
Reduced testcase:
class Time { };
struct PasswordStore {
void RemoveLogins(Time delete_begin)
{ __builtin_exit (0); }
};
template <typename g>
struct A {
void TestBody() {
PasswordStore base_store ;
base_store.RemoveLogins(Time::Time());
}
};
int main(void)
{
A<int> a;
a.TestBody();
__builtin_abort ();
}
Note this is invalid code I think and as mentioned Time::Time() should really
just be Time().
More information about the Gcc-bugs
mailing list