https://gcc.gnu.org/bugzilla/show_bug.cgi?id=85940

--- Comment #2 from Andrew Pinski <pinskia at gcc dot gnu.org> ---
Hmm,  Even clang has the same bug:
https://godbolt.org/z/fszxdGrsv

<source>:3:19: warning: use of GNU address-of-label extension
[-Wgnu-label-as-value]
  return (bool()) && x;
                  ^
<source>:3:10: error: C-style cast from 'void *' to 'bool ()' is not allowed
  return (bool()) && x;
         ^~~~~~~~~~~~~
<source>:3:22: error: use of undeclared label 'x'
  return (bool()) && x;
                     ^
1 warning and 2 errors generated.
Compiler returned: 1


So what I think is happening is both GCC and clang think (bool()) is cast to a
function type.  This one of the areas in the C++ standard which has an
ambiguity that says it should resolve to a function type and it seems like the
extension gets in the way after that.

Reply via email to