diff options
Diffstat (limited to 'gcc/cp/typeck.c')
-rw-r--r-- | gcc/cp/typeck.c | 16 |
1 files changed, 11 insertions, 5 deletions
diff --git a/gcc/cp/typeck.c b/gcc/cp/typeck.c index e100d70b1f2..8b66acc9011 100644 --- a/gcc/cp/typeck.c +++ b/gcc/cp/typeck.c @@ -2139,12 +2139,18 @@ string_conv_p (const_tree totype, const_tree exp, int warn) || TREE_CODE (TREE_OPERAND (exp, 0)) != STRING_CST) return 0; } - - /* This warning is not very useful, as it complains about printf. */ if (warn) - warning (OPT_Wwrite_strings, - "deprecated conversion from string constant to %qT", - totype); + { + if (cxx_dialect >= cxx11) + pedwarn (input_location, + pedantic ? OPT_Wpedantic : OPT_Wwrite_strings, + "ISO C++ forbids converting a string constant to %qT", + totype); + else + warning (OPT_Wwrite_strings, + "deprecated conversion from string constant to %qT", + totype); + } return 1; } |