[Bug c++/86002] New: ICE with requires in constexpr if condition
gcc-bugs at oxyware dot com
gcc-bugzilla@gcc.gnu.org
Wed May 30 18:08:00 GMT 2018
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=86002
Bug ID: 86002
Summary: ICE with requires in constexpr if condition
Product: gcc
Version: 8.1.1
Status: UNCONFIRMED
Severity: normal
Priority: P3
Component: c++
Assignee: unassigned at gcc dot gnu.org
Reporter: gcc-bugs at oxyware dot com
Target Milestone: ---
Created attachment 44214
--> https://gcc.gnu.org/bugzilla/attachment.cgi?id=44214&action=edit
Pre-processed source and command-line options
// ICE when using requires to detect welll-formedness of code using constexpr
if
struct X {};
struct Y { int i; };
template <typename T>
int f(T t)
{
if constexpr (requires { t.i; })
return t.i;
else
return {};
}
int main()
{
return f(X{}) + f(Y{});
}
More information about the Gcc-bugs
mailing list