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

Patrick Palka <ppalka at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |ppalka at gcc dot gnu.org

--- Comment #6 from Patrick Palka <ppalka at gcc dot gnu.org> ---
(In reply to Jakub Jelinek from comment #3)
> Another option is to make sure we don't call warn_duplicated_cond_add_or_warn
> when processing_template_decl or say when value_dependent_expression_p or
> similar, and instead call it during template instantiation in pt.cc after
> finish_if_stmt_cond call there.

I noticed the warning already gives up on conditions that have
TREE_SIDE_EFFECTS set, so I suppose it makes sense to do the same for
type-dependent expressions since we can't know if they have side effects until
instantiation time.

And I wonder if warn_duplicated_cond_add_or_warn should be using cp_tree_equal
instead operand_equal_p?  IIUC the latter doesn't handle C++-specific tree
codes.

Reply via email to