This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [C++ PATCH] Fix ICE on invalid typeid argument (PR c++/36405)
- From: Paolo Carlini <paolo dot carlini at oracle dot com>
- To: Jakub Jelinek <jakub at redhat dot com>
- Cc: Mark Mitchell <mark at codesourcery dot com>, Jason Merrill <jason at redhat dot com>, gcc-patches at gcc dot gnu dot org
- Date: Thu, 12 Jun 2008 12:25:21 +0200
- Subject: Re: [C++ PATCH] Fix ICE on invalid typeid argument (PR c++/36405)
- References: <20080612101009.GS8133@devserv.devel.redhat.com>
Hi Jakub,
Hi!
PR29928 stopped requiring complete type for typeid for everything but
class types. This causes ICEs with invalid arguments like non-static member
functions, which have UNKNOWN_TYPE. I believe the PR29928 change was
because of typeid (void) and typeid (int []) and IMHO we should just special
case those 2 cases - for arrays just require the element type is complete
and allow typeid (void).
I had a similar patch in testing. I'm slightly nervous about two
details: the first one is that we have to give up with an implementation
closely paralleling the standard, which explicitly talks about class
types (the reason I can see is that complete_type_or_else does a little
more than the name says, vs a larger class of errors); the second one,
in 29928 I also consistently changed another function below this one,
are we 100% sure it's ok to change only one now?
Thanks,
Paolo.