[PATCH][C++] Fix PR29433, make C++ use a lot less time/memory

Gabriel Dos Reis gdr@cs.tamu.edu
Sun Dec 10 05:53:00 GMT 2006


Mark Mitchell <mark@codesourcery.com> writes:

| Richard Guenther wrote:
| 
| [Nathan, Jason, please see below for question for you as C++ maintainers.]
| 
| >> | 2006-12-09  Richard Guenther  <rguenther@suse.de>
| >> | 
| >> | 	* include/bits/stl_tree.h (struct _Rb_tree): Qualify types.
| >> | 
| >> | 	* g++.dg/warn/implicit-typename1.C: Qualify types.
| >> | 	* g++.dg/parse/crash12.C: Likewise.
| >> | 	* g++.dg/tree-ssa/pr22444.C: Likewise.
| >>
| >> [...]
| >>
| >> Thanks for doing this.  Please check it in.
| > 
| > I have applied the g++.dg parts only, libstdc++ needs some more fixing.
| 
| I think this we may be moving too quickly on this.
| 
| First, I don't think it's 100% clear that this code is invalid, though I
| agree that that's a reasonable interpretation.  G++ and EDG agree that
| this code is valid:
| 
|   struct S {
|     struct T {};
|     T T();
|   };
| 
| so, like it or not, name lookup does honor the stat hack, and there's an
| argument that for:
| 
|   struct T {};
|   struct S {
|     T T();
|   };
| 
| name lookup for the T appearing as a type-specifier would still find the
| outer T, and that therefore the binding to the member function T does
| not affect validity.

I don't follow that reasoning.

| More importantly, we know that this code is in our testsuite, in
| libstdc++, and accepted by EDG -- all of which suggests that this
| construct is likely in relatively widespread use.  I'm not sure that
| it's a good tradeoff to break that code for the sake of a diagnostic
| which is explicitly not required by the standard.

And the code is explicitly invalid.  And we already reject the code,
and at some point in the past, we regressed and got PR filled for that
regression. I don't believe we have to lower the quality to in the
search of mimicing EDG.   

-- Gaby



More information about the Gcc-patches mailing list