[Bug c++/100956] Unused variable warnings ignore "if constexpr" blocks where variables are conditionally used

redi at gcc dot gnu.org gcc-bugzilla@gcc.gnu.org
Tue Jun 8 12:35:32 GMT 2021


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

Jonathan Wakely <redi at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |RESOLVED
         Resolution|---                         |DUPLICATE

--- Comment #1 from Jonathan Wakely <redi at gcc dot gnu.org> ---
The warning is already fixed in the GCC 10 branch.

N.B. if you have a loop that does nothing but run trivial destructors, GCC will
optimize it out anyway.

*** This bug has been marked as a duplicate of bug 81676 ***


More information about the Gcc-bugs mailing list