[Bug c++/85940] Address of label breaks ISO C++ program despite non-GNU dialect and pedantic

2021-05-30 Thread pinskia at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=85940

--- Comment #2 from Andrew Pinski  ---
Hmm,  Even clang has the same bug:
https://godbolt.org/z/fszxdGrsv

:3:19: warning: use of GNU address-of-label extension
[-Wgnu-label-as-value]
  return (bool()) && x;
  ^
:3:10: error: C-style cast from 'void *' to 'bool ()' is not allowed
  return (bool()) && x;
 ^
: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.

[Bug c++/85940] Address of label breaks ISO C++ program despite non-GNU dialect and pedantic

2018-05-28 Thread rguenth at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=85940

Richard Biener  changed:

   What|Removed |Added

 Status|UNCONFIRMED |NEW
   Last reconfirmed||2018-05-28
 Ever confirmed|0   |1
  Known to fail||3.3.6, 3.4.6, 4.8.5, 8.1.0

--- Comment #1 from Richard Biener  ---
Confirmed.  It never worked.