This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [patch] Fix PR c++/21686: Broken quotation in error message
- From: Paul Koning <pkoning at equallogic dot com>
- To: reichelt at igpm dot rwth-aachen dot de
- Cc: gcc-patches at gcc dot gnu dot org
- Date: Tue, 24 May 2005 09:56:40 -0400
- Subject: Re: [patch] Fix PR c++/21686: Broken quotation in error message
- References: <200505240033.j4O0XMOO003284@relay.rwth-aachen.de>
>>>>> "Volker" == Volker Reichelt <reichelt@igpm.rwth-aachen.de> writes:
Volker> On mainline and the 4.0 branch we get the error message
Volker> PR21686.cc: In constructor 'foo()::A::A()': PR21686.cc:4:
Volker> error: use of %<auto%> variable from containing function
Volker> PR21686.cc:3: error: 'int i' declared here
Volker> for the code snippet
Volker> void foo() { int i; struct A { A() { i; } }; }
Volker> Note the broken quotation of "auto". This is due to the
Volker> following code in cp/semantics.c:
Volker> error ("use of %s from containing function", (TREE_CODE
Volker> (decl) == VAR_DECL ? "%<auto%> variable" : "parameter"));
Volker> The quotation with %< %> just doesn't work in strings
Volker> substituted by %s. The attached patch fixes the quotation by
Volker> not using substitution.
There's another reason why that is a good change: the original code
violates GNU coding standards:
http://www.gnu.org/prep/standards/standards.html#Internationalization
paul