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: [C++ PATCH] Fix ICE on invalid typeid argument (PR c++/36405)


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.


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