https://gcc.gnu.org/bugzilla/show_bug.cgi?id=71448
Jakub Jelinek <jakub at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Status|NEW |ASSIGNED
Assignee|unassigned at gcc dot gnu.org |jakub at gcc dot gnu.org
--- Comment #5 from Jakub Jelinek <jakub at gcc dot gnu.org> ---
Created attachment 38658
--> https://gcc.gnu.org/bugzilla/attachment.cgi?id=38658&action=edit
gcc7-pr71448.patch
Untested full patch.
That said, I wonder if it is ok that we don't reject clear out of bound
POINTER_PLUS_EXPR in constexprs, like:
static constexpr const char foo[] = "foo";
static constexpr const char *bar = "bar";
static_assert (foo < foo + 30, "check");
static_assert (foo != foo + 30, "check");
static_assert (bar <= bar + 30, "check");
static_assert (bar != bar + 30, "check");
But that is preexisting, the patch doesn't really change anything on that, and
most likely we want to handle this in the FE (if at all).