This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: C++ PATCH: PR 23293
David Abrahams wrote:
>>http://gcc.gnu.org/bugzilla/show_bug.cgi?id=23293
>
> This one would be better if you only preserved namespace-scope
> typedefs.
>
>>http://gcc.gnu.org/bugzilla/show_bug.cgi?id=17763 is another example.
>
> This one, too.
I considered that -- but for the second alternative I don't think it
helps; there, looking at Comment #7, the only typedefs are in fact in
namespace scope.
Your idea of dropping typedefs for simple types might help, but there's
still the risk that a distant typedef wandering around in a namespace
about which you know nothing will start showing up in messages
pertaining to your code.
I'm not opposed to people making refinements here. I think the best
plan would be to treat "Outer<X>" as a typedef for "Outer<int>"
internally, and then handle it like we do typedefs elsewhere, which,
would I think meet both sets of requests. However, to do that, we need
to overhaul internal infrastructure in a way that's not tractable.
The current problem is to do the least bad thing in the very short term.
> I fail to see how this very real problem:
>
> theory.cc:22: double ch (dummy<0>, dummy<n>) [with unsigned int m = 0]
> ^^^^^^^^
> \__ INCORRECT
>
> would be solved by using numbers instead of actual identifiers. You'd
> end up with something like:
>
> theory.cc:22: double ch (dummy<0>, dummy<#1>) [with unsigned int #2 = 0]
> ^^^^^^^^^
> \__ STILL INCORRECT
That's not what I meant. But, hey, let's not get into this; it should
be my problem to come up with a proper proposal before wasting
everyone's time debating it.
--
Mark Mitchell
CodeSourcery, LLC
mark@codesourcery.com
(916) 791-8304