This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug sanitizer/71962] error: ‘((& x) != 0u)’ is not a constant expression
- From: "redi at gcc dot gnu.org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Fri, 21 Jul 2017 12:29:10 +0000
- Subject: [Bug sanitizer/71962] error: ‘((& x) != 0u)’ is not a constant expression
- Auto-submitted: auto-generated
- References: <bug-71962-4@http.gcc.gnu.org/bugzilla/>
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), "");
^~~~~~~~