[Bug c++/71537] GCC rejects consetxpr boolean conversions and comparisons on the result of pointer arithmetic.
eric at efcs dot ca
gcc-bugzilla@gcc.gnu.org
Wed Dec 7 21:20:00 GMT 2016
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=71537
Eric Fiselier <eric at efcs dot ca> changed:
What |Removed |Added
----------------------------------------------------------------------------
Status|RESOLVED |REOPENED
Resolution|FIXED |---
--- Comment #17 from Eric Fiselier <eric at efcs dot ca> ---
This has not been fixed. As mentioned the original reproducer still fails to
compile when it appears at block scope:
// g++ -std=c++1z test.cpp
constexpr bool foo() {
constexpr int n[42] = {1};
constexpr int x = n ? 1 : 0; // Accepted.
constexpr int xx = n + 1 ? 1 : 0; // Rejected
constexpr int xxx = "abc" + 1 ? 1 : 0; // Newly accepted.
return true;
}
int main() { static_assert(foo(), ""); }
More information about the Gcc-bugs
mailing list