[Bug c++/82745] Fails to warn on narrowing conversion by std::forward (e.g. when calling make_unique)

helge at penne dot no gcc-bugzilla@gcc.gnu.org
Fri Oct 27 13:06:00 GMT 2017


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

helge at penne dot no changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
            Summary|Fails to warn on narrowing  |Fails to warn on narrowing
                   |conversion when using       |conversion by std::forward
                   |make_unique                 |(e.g. when calling
                   |                            |make_unique)

--- Comment #1 from helge at penne dot no ---
Some further experiments show that the compiler also fails to detect narrowing
conversions in calls to std::vector::emplace_back and std::map::emplace.  It
seems fair to guess that anything that uses perfect forwarding and std::forward
is suspect.


More information about the Gcc-bugs mailing list