diff options
author | Jason Merrill <jason@gcc.gnu.org> | 2011-11-02 16:16:43 -0400 |
---|---|---|
committer | Jason Merrill <jason@gcc.gnu.org> | 2011-11-02 16:16:43 -0400 |
commit | 25339f1097a119662a4989964f32143ad44edbd3 (patch) | |
tree | 883396e26db08ff838de9608ab092c69fcce8870 /gcc/cp/decl.c | |
parent | 24748eb48e44ae268686a795149edc03af0e4310 (diff) | |
download | gcc-25339f1097a119662a4989964f32143ad44edbd3.zip gcc-25339f1097a119662a4989964f32143ad44edbd3.tar.gz gcc-25339f1097a119662a4989964f32143ad44edbd3.tar.bz2 |
re PR c++/50810 (c++0x-compat does not warn about narrowing conversions)
PR c++/50810
gcc/c-family
* c-opts.c (c_common_handle_option): Enable -Wnarrowing as part
of -Wall; include -Wnarrowing in -Wc++0x-compat; adjust default
Wnarrowing for C++0x and C++98.
* c.opt ([Wnarrowing]): Update.
gcc/cp
* typeck2.c (check_narrowing): Adjust OPT_Wnarrowing diagnostics.
(digest_init_r): Call check_narrowing irrespective of the C++ dialect.
* decl.c (check_initializer): Likewise.
* semantics.c (finish_compound_literal): Likewise.
gcc/
* configure.ac: Add -Wno-narrowing to warning options.
libcpp/
* configure.ac: Add -Wno-narrowing to warning options.
From-SVN: r180794
Diffstat (limited to 'gcc/cp/decl.c')
-rw-r--r-- | gcc/cp/decl.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/gcc/cp/decl.c b/gcc/cp/decl.c index 860556c..edbc783 100644 --- a/gcc/cp/decl.c +++ b/gcc/cp/decl.c @@ -5538,7 +5538,7 @@ check_initializer (tree decl, tree init, int flags, tree *cleanup) else { init = reshape_init (type, init, tf_warning_or_error); - if (cxx_dialect >= cxx0x && SCALAR_TYPE_P (type)) + if (SCALAR_TYPE_P (type)) check_narrowing (type, init); } } |