[Bug c++/104160] Wrongly allowed: Function argumentin constant expression

2022-12-01 Thread pinskia at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=104160 Andrew Pinski changed: What|Removed |Added Resolution|--- |DUPLICATE Status|NEW

[Bug c++/104160] Wrongly allowed: Function argumentin constant expression

2022-06-22 Thread csaba_22 at yahoo dot co.uk via Gcc-bugs
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

[Bug c++/104160] Wrongly allowed: Function argumentin constant expression

2022-01-21 Thread pinskia at gcc dot gnu.org via Gcc-bugs
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()) { ^

[Bug c++/104160] Wrongly allowed: Function argumentin constant expression

2022-01-21 Thread pinskia at gcc dot gnu.org via Gcc-bugs
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.

[Bug c++/104160] Wrongly allowed: Function argumentin constant expression

2022-01-21 Thread pinskia at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=104160 Andrew Pinski changed: What|Removed |Added Ever confirmed|0 |1 Status|UNCONFIRMED

[Bug c++/104160] Wrongly allowed: Function argumentin constant expression

2022-01-21 Thread pinskia at gcc dot gnu.org via Gcc-bugs
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 =