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][C++] Fix PR29433, make C++ use a lot less time/memory


Jason Merrill wrote:

When we see the first T in "T T();" we have no idea that it's supposed to be a type-specifier, so we can't look it up specially.

I don't understand, we must be looking it up specially, otherwise the struct stat hack wouldn't work.


Except for cdtors & conversion ops, declarations have a leading type specifier right? So the first T in 'T T()' should be looked up as a type specifier? Otherwise I don't see how

int T;
struct S {
struct T {};
T T (); // #1
};
is being parsed (we accept that). Why are we allowing the first T in #1 to lookup the type tag 'struct S::T' and not the decl '::T'?


But we reject the following:
struct S {
  int T;
  struct T {};
  T baz ();
};

yuck!

nathan

--
Nathan Sidwell    ::   http://www.codesourcery.com   ::         CodeSourcery
nathan@codesourcery.com    ::     http://www.planetfall.pwp.blueyonder.co.uk


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