This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [patch] Fix PR c++/21686: Broken quotation in error message


>>>>> "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



Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]