from cp/typeck.c: permerror (input_location, "%s expression list treated as compound expression", msg); The placeholder "msg" gets the value "new initializer" in init.c, but that string literal is not enclosed in _(...), therefore it won't be translated. That call seems to be the only place where build_x_compound_expr_from_vec is actually called, so having a placeholder might be unnecessary overhead.
"new-initializer" is a grammar term in the C++ standard, so maybe it shouldn't be translated.
But then shouldn't it be spelled "new-initializer", not "new initializer"?
I wonder if it would be worthwhile to add format specifier to the pretty printer for terms of the grammar (say %T or something). That would make it possible to a) clearly distinguish them from plain English text that must be translated and perhaps also help diagnose unquoted %s arguments via -Wformat, and b) format them in a distinct font (such as italics or terminals that support it, as for instance Gnome terminal does).
Martin, that might be nice for IDEs too, which can presumably aren't restricted to using a single font like most terminals. (In reply to Roland Illig from comment #2) > But then shouldn't it be spelled "new-initializer", not "new initializer"? It's still clearly related to the same thing, even without the hyphen. At the very least, "new" shouldn't be translated, because it refers to the C++ keyword, which is always spelled "new" and not "neu" or "nouveau" or anything else. It's an initializer for a new-expression, not an initializer that is newer than some other initializer.
(In reply to Jonathan Wakely from comment #4) > At the very least, "new" shouldn't be translated, because it refers to the > C++ keyword, which is always spelled "new" and not "neu" or "nouveau" or > anything else. It's an initializer for a new-expression, not an initializer > that is newer than some other initializer. Then, it should be "%<new%> initializer". Keywords should always be quoted: https://gcc.gnu.org/wiki/DiagnosticsGuidelines#Quoting
No, not if I'm right that it's referring to new-initializer. The C++ standard defines a new-expression and a new-initializer, and those are related to the 'new' keyword, but they are not keywords.
Changing component to translation, but leaving UNCONFIRMED since there seems to be disagreement
(In reply to Eric Gallager from comment #7) > Changing component to translation, but leaving UNCONFIRMED since there seems > to be disagreement Putting in WAITING in the hopes that someone else will decide one way or another whether this bug is valid or not.
(In reply to Eric Gallager from comment #8) > (In reply to Eric Gallager from comment #7) > > Changing component to translation, but leaving UNCONFIRMED since there seems > > to be disagreement > > Putting in WAITING in the hopes that someone else will decide one way or > another whether this bug is valid or not. No reply; closing per Jonathan in comment #6
I think quoting/translating grammar terms is a general problem in the C++ front-end (perhaps to a lesser extent also in the rest of GCC as well). The inconsistencies it leads to can be seen in the translated messages. For instance, de.po has these two messages: #: cp/init.c:2906 #, gcc-internal-format msgid "array size in new-expression must be constant" msgstr "Arraygröße in »new«-Ausdruck muss konstant sein" and #: cp/parser.c:8454 #, gcc-internal-format msgid "initialization of new-expression for type %<auto%> requires exactly one element" msgstr "Initialisierung des new-Ausdrucks für Typ %<auto%> erfordert genau ein Element" In the first one, 'new' is quoted as if it was a keyword, but in the second one it isn't (as it shouldn't be). Another example is one of inconsistent translation (it's not the fault of the translator -- the msgid mixes plain English text with a grammar term/expression syntax without making it clear what ends where): #: cp/parser.c:37546 #, gcc-internal-format msgid "expected id-expression (arguments)" msgstr "»id-expression (arguments)« erwartet" #: cp/parser.c:5790 #, gcc-internal-format msgid "expected id-expression" msgstr "ID-Ausdruck erwartet" I don't know what the text of the C++ standard reads like in German to say what the right way to solve this is. Does the German text refer to 'new'-Ausdruck in the grammar, or does it use '/new-expression/' like the English edition, or something else? Roland? (GCC is also inconsistent in the hyphenation of grammar terms like "constant-expression" and so is the translation.)