/* * the following code outputs ":o" on 4.7.2 when compiled with -O0 * and ":)" when compiled with -O1 * */ #include <iostream> class Plap { public: double value; Plap(int a, int b) { value = (double)a / (double)b; } }; int main() { int i = 1; int j = 3; Plap plap(i, j); if (plap.value != ((double)i / (double)j)) std::cout << ":o" << std::endl; else std::cout << ":)" << std::endl; return 0; }
I bet this is a dup of bug 323.
Dup *** This bug has been marked as a duplicate of bug 323 ***