[Bug c++/67863] -Wtautological-compare warns when it shouldn't

2015-10-06 Thread mpolacek at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=67863

Marek Polacek  changed:

   What|Removed |Added

 Status|ASSIGNED|RESOLVED
 Resolution|--- |FIXED

--- Comment #4 from Marek Polacek  ---
Fixed for GCC 6.


[Bug c++/67863] -Wtautological-compare warns when it shouldn't

2015-10-06 Thread mpolacek at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=67863

--- Comment #3 from Marek Polacek  ---
Author: mpolacek
Date: Tue Oct  6 17:56:23 2015
New Revision: 228540

URL: https://gcc.gnu.org/viewcvs?rev=228540=gcc=rev
Log:
PR c++/67863
* call.c (build_conditional_expr_1): Build the COND_EXPR with
a location.

* c-c++-common/Wtautological-compare-4.c: New test.

Added:
trunk/gcc/testsuite/c-c++-common/Wtautological-compare-4.c
Modified:
trunk/gcc/cp/ChangeLog
trunk/gcc/cp/call.c
trunk/gcc/testsuite/ChangeLog


[Bug c++/67863] -Wtautological-compare warns when it shouldn't

2015-10-06 Thread mpolacek at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=67863

Marek Polacek  changed:

   What|Removed |Added

 Status|UNCONFIRMED |NEW
   Last reconfirmed||2015-10-06
 Ever confirmed|0   |1

--- Comment #1 from Marek Polacek  ---
And because of the missing location in cc1plus this
 1911   /* Don't warn for various macro expansions.  */
 1912   if (from_macro_expansion_at (loc)
 1913   || from_macro_expansion_at (EXPR_LOCATION (lhs))
 1914   || from_macro_expansion_at (EXPR_LOCATION (rhs)))
 1915 return;
doesn't trigger so we warn.


[Bug c++/67863] -Wtautological-compare warns when it shouldn't

2015-10-06 Thread mpolacek at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=67863

Marek Polacek  changed:

   What|Removed |Added

   Keywords||diagnostic
   Target Milestone|--- |6.0


[Bug c++/67863] -Wtautological-compare warns when it shouldn't

2015-10-06 Thread mpolacek at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=67863

Marek Polacek  changed:

   What|Removed |Added

 Status|NEW |ASSIGNED
   Assignee|unassigned at gcc dot gnu.org  |mpolacek at gcc dot 
gnu.org

--- Comment #2 from Marek Polacek  ---
I think I have a fix.