https://gcc.gnu.org/bugzilla/show_bug.cgi?id=91391
Jakub Jelinek <jakub at gcc dot gnu.org> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |jakub at gcc dot gnu.org --- Comment #3 from Jakub Jelinek <jakub at gcc dot gnu.org> --- (In reply to Marek Polacek from comment #2) > ...except when it's: > > void > fn (int *a, int b, int c) > { > a[b < c, b > c]; // should warn > } Maybe handle it instead with a parser flag that in certain contexts you temporarily enable or disable? Temporarily enable when parsing the [] expression and temporarily disable when parsing an assignment expression? Or instead hand inline cp_parser_expression into cp_parser_postfix_open_square_expression and do the warning in the inlined code? Or add another defaulted argument to cp_parser_expression and only warn if that argument is true and only pass true if called from cp_parser_postfix_open_square_expression? Or somehow merge the cast_p, decltype_p and this new warn_comma_p into a bitmask (using enum?) and just pass one argument instead of 3?