[Bug c++/65801] [5/6 Regression] Allow -Wno-narrowing to silence stricter C++11 narrowing rules

trippels at gcc dot gnu.org gcc-bugzilla@gcc.gnu.org
Sat Apr 18 18:47:00 GMT 2015


Markus Trippelsdorf <trippels at gcc dot gnu.org> changed:

           What    |Removed                     |Added
             Status|UNCONFIRMED                 |NEW
   Last reconfirmed|                            |2015-04-18
                 CC|                            |trippels at gcc dot gnu.org
            Summary|Allow -Wno-narrowing to     |[5/6 Regression] Allow
                   |silence stricter C++11      |-Wno-narrowing to silence
                   |narrowing rules             |stricter C++11 narrowing
                   |                            |rules
     Ever confirmed|0                           |1

--- Comment #1 from Markus Trippelsdorf <trippels at gcc dot gnu.org> ---
Yes. This also breaks building Chromium.

markus@x4 ~ % echo "int main () {int i = { 0xFFFFFFFF };}" | g++ -std=c++11
-Wno-narrowing -x c++ -
<stdin>: In function ‘int main()’:
<stdin>:1:35: error: narrowing conversion of ‘4294967295u’ from ‘unsigned int’
to ‘int’ inside { }

While the standard is clear that this is an error,
accepting -Wno-narrowing as in 4.8, 4.9 and clang looks acceptable to me.

More information about the Gcc-bugs mailing list