[Bug c++/82959] g++ doesn't appreciate C++17 evaluation order rules for overloaded operators
mukesh.kapoor at oracle dot com
gcc-bugzilla@gcc.gnu.org
Tue Nov 14 20:01:00 GMT 2017
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=82959
Mukesh Kapoor <mukesh.kapoor at oracle dot com> changed:
What |Removed |Added
----------------------------------------------------------------------------
CC| |mukesh.kapoor at oracle dot com
--- Comment #2 from Mukesh Kapoor <mukesh.kapoor at oracle dot com> ---
Here is a reduced test case that shows the same problem:
extern "C" int printf(const char*, ...);
class Int {
public:
bool operator&&(const Int& rhs) const { return val && rhs.val; }
private:
int val = 0;
};
int main()
{
Int xx;
(printf("first\n"), xx) && (printf("second\n"), xx);
};
More information about the Gcc-bugs
mailing list