[Bug c++/86000] ICE with requires statement in a non constexpr if

gcc-bugs at oxyware dot com gcc-bugzilla@gcc.gnu.org
Thu May 31 14:53:00 GMT 2018


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

--- Comment #2 from Hubert Matthews <gcc-bugs at oxyware dot com> ---
template <typename T>
int f()
{
    bool check = requires { 3 > 4; };
    if (check) return 1;
    else return 2;
}

compiles cleanly and gives the expected result.  This is essentially the same
code but with the check performed separately and stored in an intermediate
variable.


More information about the Gcc-bugs mailing list