diff options
author | Volker Reichelt <v.reichelt@netcologne.de> | 2017-02-27 13:29:35 +0000 |
---|---|---|
committer | Volker Reichelt <reichelt@gcc.gnu.org> | 2017-02-27 13:29:35 +0000 |
commit | 24f12823837aa38026253675c822f219a3a34c13 (patch) | |
tree | d07c2ed2cb36a889c6abbfe3a12bde7bea896e41 /gcc | |
parent | c91c3003b5c4170652925da487d22336461175eb (diff) | |
download | gcc-24f12823837aa38026253675c822f219a3a34c13.zip gcc-24f12823837aa38026253675c822f219a3a34c13.tar.gz gcc-24f12823837aa38026253675c822f219a3a34c13.tar.bz2 |
init.c: Include intl.h.
2017-02-27 Volker Reichelt <v.reichelt@netcologne.de>
* init.c: Include intl.h.
(build_new_1): Move message strings into pedwarn to make them
-Wformat-security friendly. Mark string for translation.
* pt.c (tsubst_copy_and_build): Mark string for translation.
Make the pointer const.
* semantics.c (finish_id_expression): Mark strings for
* translation.
From-SVN: r245757
Diffstat (limited to 'gcc')
-rw-r--r-- | gcc/cp/ChangeLog | 9 | ||||
-rw-r--r-- | gcc/cp/init.c | 16 | ||||
-rw-r--r-- | gcc/cp/pt.c | 9 | ||||
-rw-r--r-- | gcc/cp/semantics.c | 6 |
4 files changed, 24 insertions, 16 deletions
diff --git a/gcc/cp/ChangeLog b/gcc/cp/ChangeLog index 03b79f1..b2459ce 100644 --- a/gcc/cp/ChangeLog +++ b/gcc/cp/ChangeLog @@ -1,3 +1,12 @@ +2017-02-27 Volker Reichelt <v.reichelt@netcologne.de> + + * init.c: Include intl.h. + (build_new_1): Move message strings into pedwarn to make them + -Wformat-security friendly. Mark string for translation. + * pt.c (tsubst_copy_and_build): Mark string for translation. + Make the pointer const. + * semantics.c (finish_id_expression): Mark strings for translation. + 2017-02-25 Jakub Jelinek <jakub@redhat.com> * call.c (build_op_delete_call): Make msg1 and msg2 const. diff --git a/gcc/cp/init.c b/gcc/cp/init.c index 13ade8a..b830822 100644 --- a/gcc/cp/init.c +++ b/gcc/cp/init.c @@ -29,6 +29,7 @@ along with GCC; see the file COPYING3. If not see #include "varasm.h" #include "gimplify.h" #include "c-family/c-ubsan.h" +#include "intl.h" static bool begin_init_stmts (tree *, tree *); static tree finish_init_stmts (bool, tree, tree); @@ -2803,15 +2804,12 @@ build_new_1 (vec<tree, va_gc> **placement, tree type, tree nelts, { if (complain & tf_warning_or_error) { - const char *msg; - if (typedef_variant_p (orig_type)) - msg = ("non-constant array new length must be specified " - "directly, not by typedef"); - else - msg = ("non-constant array new length must be specified " - "without parentheses around the type-id"); - pedwarn (EXPR_LOC_OR_LOC (outer_nelts, input_location), - OPT_Wvla, msg); + pedwarn (EXPR_LOC_OR_LOC (outer_nelts, input_location), OPT_Wvla, + typedef_variant_p (orig_type) + ? "non-constant array new length must be specified " + "directly, not by typedef" + : G_("non-constant array new length must be specified " + "without parentheses around the type-id")); } else return error_mark_node; diff --git a/gcc/cp/pt.c b/gcc/cp/pt.c index aaca70f..d5428ed 100644 --- a/gcc/cp/pt.c +++ b/gcc/cp/pt.c @@ -17190,10 +17190,11 @@ tsubst_copy_and_build (tree t, stricter. */ bool in_lambda = (current_class_type && LAMBDA_TYPE_P (current_class_type)); - char const *msg = "%qD was not declared in this scope, " - "and no declarations were found by " - "argument-dependent lookup at the point " - "of instantiation"; + char const *const msg + = G_("%qD was not declared in this scope, " + "and no declarations were found by " + "argument-dependent lookup at the point " + "of instantiation"); bool diag = true; if (in_lambda) diff --git a/gcc/cp/semantics.c b/gcc/cp/semantics.c index 67f8b92..bcfdd66 100644 --- a/gcc/cp/semantics.c +++ b/gcc/cp/semantics.c @@ -3510,7 +3510,7 @@ finish_id_expression (tree id_expression, && DECL_CONTEXT (decl) == NULL_TREE && !cp_unevaluated_operand) { - *error_msg = "use of parameter outside function body"; + *error_msg = G_("use of parameter outside function body"); return error_mark_node; } } @@ -3520,13 +3520,13 @@ finish_id_expression (tree id_expression, if (TREE_CODE (decl) == TEMPLATE_DECL && !DECL_FUNCTION_TEMPLATE_P (decl)) { - *error_msg = "missing template arguments"; + *error_msg = G_("missing template arguments"); return error_mark_node; } else if (TREE_CODE (decl) == TYPE_DECL || TREE_CODE (decl) == NAMESPACE_DECL) { - *error_msg = "expected primary-expression"; + *error_msg = G_("expected primary-expression"); return error_mark_node; } |