This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug sanitizer/71962] error: ‘((& x) != 0u)’ is not a constant expression


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

Jonathan Wakely <redi at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |NEW
   Last reconfirmed|                            |2017-07-21
     Ever confirmed|0                           |1
      Known to fail|7.0                         |7.1.0, 8.0

--- Comment #5 from Jonathan Wakely <redi at gcc dot gnu.org> ---
A simpler test:

int main()
{
  static constexpr int x = 0;
  static_assert(bool(&x), "");
}

ubsan.cc: In function ‘int main()’:
ubsan.cc:4:3: error: non-constant condition for static assertion
   static_assert(bool(&x), "");
   ^~~~~~~~~~~~~
ubsan.cc:4:17: error: ‘((& x) != 0)’ is not a constant expression
   static_assert(bool(&x), "");
                 ^~~~~~~~

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]