[Bug c++/71675] __atomic_compare_exchange_n returns wrong type for typed enum
msebor at gcc dot gnu.org
gcc-bugzilla@gcc.gnu.org
Tue Jun 28 14:04:00 GMT 2016
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=71675
Martin Sebor <msebor at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Keywords|documentation |rejects-valid
--- Comment #3 from Martin Sebor <msebor at gcc dot gnu.org> ---
You're right. I was mistaken in comment #1 about the return value: the
function does return a true/false result, but it appears to be of the wrong
type. So the documentation is correct (it matches C11 atomic_compare_exchange)
and the bug is in the compiler.
The root cause seems to be the resolve_overloaded_builtin function in
builtins.c calling sync_resolve_return to convert the bool result to the enum,
which the C++ front end then rejects.
More information about the Gcc-bugs
mailing list