[C/C++ PATCH] Add -Wlogical-not-parentheses (PR c/49706)

Jakub Jelinek jakub@redhat.com
Mon Jun 2 17:14:00 GMT 2014


On Mon, Jun 02, 2014 at 07:04:58PM +0200, Marek Polacek wrote:
> > Do we actually want to warn in that case?  As the patch doesn't warn
> > if the type is bool or vector, if somebody instantiates the above with
> > say T=bool, U=bool, then we'd warn on something that otherwise will not be
> > warned about when not in template.
> > But to warn about this during instantiation, we'd need to somehow tell
> > tsubst* whether it was !t == u or (!t) == u ...
> 
> Ah - indeed.  So I suggest to stay with !processing_template_decl ;).

Well, if the vars are known not to be boolean, even in template, you can
warn about this right away (i.e. if they aren't
type_dependent_expression_p).

	Jakub



More information about the Gcc-patches mailing list