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

--- Comment #1 from Andrew Pinski <pinskia at gcc dot gnu.org> ---
Confirmed reduced testcase:
```

#define size 3
constexpr auto tester() {
  int *v = new int[size];
  auto p = &v[size+1];
  bool t = &v[0] == p;
  delete[] v;
  return t;
}

static_assert(!tester());

#if 0
constexpr auto tester1() {
  int v[size];
  auto p = &v[size+1];
  bool t = &v[0] == p;
  return t;
}
static_assert(!tester1());
#endif
```

GCC does catch the static allocated one; just not the dynamic allocated one.

Reply via email to