This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: Bootstrap failure in tree-object-size.c due to -Wnarrowing (was: [C++ Patch] PR 50810)
On Sun, Oct 23, 2011 at 7:56 PM, Paolo Carlini <paolo.carlini@oracle.com> wrote:
> ... and the patch ;)
I am bit puzzled by this:
+This flag is included in @option{-Wc++0x-compat}.
+With -std=c++0x, @option{-Wno-narrowing} suppresses the diagnostic
+required by the standard.
and this:
- /* If we're allowing C++0x constructs, don't warn about C++0x
- compatibility problems. */
if (cxx_dialect == cxx0x)
- warn_cxx0x_compat = 0;
+ {
+ /* If we're allowing C++0x constructs, don't warn about C++98
+ identifiers which are keywords in C++0x. */
+ warn_cxx0x_compat = 0;
+ if (warn_narrowing == -1)
+ warn_narrowing = 1;
+ }
We do not use -W or -Wno- to suppressed *required* diagnostics. So,
when -std=c++0x,
-Wno-narrowing should not have any effect. However with
-Wc++0x-compat, it could
make sense to have -Wno-narrowing suppress the diagnostic.
The point is this: we do not use -W flags to change a standards semantics.
But we use -W to make suggestions (e.g. warnings) so a suggesting should be
suppressed only in the context of another suggestion (-Wc++0x-compat.)