int main() { auto b = requires { true ? [] {} : [] {}; }; }
gcc rejects this valid syntax with source>:2:32: error: expected ':' before '{' token 2 | auto b = requires { true ? [] {} : [] {}; }; | ^~ | : <source>:2:33: error: expected primary-expression before '{' token 2 | auto b = requires { true ? [] {} : [] {}; }; | ^ <source>:2:35: error: expected ';' before ':' token 2 | auto b = requires { true ? [] {} : [] {}; }; | ^~ | ; https://godbolt.org/z/4c3PPb5Pb
And gcc accepts the following invalid syntax: int main() { auto b = requires { true ? [] : [] {}; }; } https://godbolt.org/z/xeE1oYs1Y
(In reply to 康桓瑋 from comment #2) > And gcc accepts the following invalid syntax: > > int main() { > auto b = requires { true ? [] : [] {}; }; > } > > https://godbolt.org/z/xeE1oYs1Y It seems like the single [] makes gcc totally broken. int main() { auto b = requires { true ? [] : []!-!-[]?[]; }; } https://godbolt.org/z/EPTE6zf5E
maybe dup of PR99546.