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 for 3.3] Fix PR10849


Mark Mitchell wrote


Thanks for working on this. Dealing with the old parser is so unappetizing...

I'm not sure why you're setting *new_type_p the way you do; that's
supposed to be set if a new type is being declared (i.e., if a
class-head, rather than an elaborated-type-specifier, is being
processed).  Why is the logic you used right?

Also, where is the pop_scope() corresponding to the push_scope() you
added?  Is there any way that you could cue the disabling off of
maybe_process_partial_specialization?

This particular use of 'new_type_flag' is for case like

 class A::B {
   ...
 };

where 'A' is a class or namespace. So inside the definition of this class, name lookup is performed in the scope of 'A'. Also this
affects access checking of the class head 'A::B' itself. The
'new_type_flag' is checked later in 'finish_class_definition'
called by 'structsp' non-terminal. So the 'pop_scope' is actually
inside that function.


About the 'maybe_process_partial_specialization' solution, deferred access for both class head and base classes are already inserted
in the 'type_lookups' list. We could walk the list and get rid of
the class head there but I think it is ugly.


--Kriang




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