[Bug c++/96414] Second char relation test incorrect with constexpr dynamic allocation

2021-04-18 Thread ppalka at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=96414 Patrick Palka changed: What|Removed |Added Status|UNCONFIRMED |RESOLVED Resolution|---

[Bug c++/96414] Second char relation test incorrect with constexpr dynamic allocation

2020-08-01 Thread pkeir at outlook dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=96414 --- Comment #1 from Paul Keir --- constexpr int lt_fun(const char& c1, const char& c2) { return c1 < c2; } constexpr bool doit() { char *pc = new char; const char* s = "a"; *pc = 'b'; lt_fun(*s, *pc); // a < b *pc = 'a';