https://gcc.gnu.org/bugzilla/show_bug.cgi?id=104160
Andrew Pinski changed:
What|Removed |Added
Resolution|--- |DUPLICATE
Status|NEW
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=104160
Csaba Ráduly changed:
What|Removed |Added
CC||csaba_22 at yahoo dot co.uk
--- Comment
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=104160
--- Comment #4 from Andrew Pinski ---
The error message from clang is:
:28:19: note: function parameter 'JSONValue' with unknown value cannot
be used in a constant expression
if constexpr (JSONValue.isArray()) {
^
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=104160
--- Comment #3 from Andrew Pinski ---
Hmm, MSVC accepts this code just like GCC.
ICC does too.
Only clang rejects it.
If Value was not marked as a constexpr, then GCC rejects it too.
I do have wonder if clang is right to reject this or not.
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=104160
Andrew Pinski changed:
What|Removed |Added
Ever confirmed|0 |1
Status|UNCONFIRMED
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=104160
--- Comment #1 from Andrew Pinski ---
Reduced testcase:
struct Array {
static constexpr bool isArray() noexcept { return true; }
};
template
constexpr void buggyImpl(const JSONVariant& JSONValue) noexcept {
constexpr bool t = JSONValu