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 PR7639


Mark Mitchell wrote:

This might be a work-around for the problem, but I'm not happy with
the approach.

The basic problem is that the can_complete_without_circularity stuff
has made template classes different from ordinary classes; ordinary
classes never have data members with incomplete types.  The reason
we needed can_complete_without_circularity was basically that we
were mishandling tyenames and/or an implicit-typename (now deprecated)
problem.

I'd like to see if we can unravel the basic problem; if we can do
that then we can get back to the situation where template classes
and normal classes are treated in the same way, which would be
better.

The problem is that the standard wasn't clear about how to do the
template instantiation. There were dependency problems that force us
to implement the code in instantiate_class_template this way.
We have to process nested types, member data, member functions,
friends in this order, and then instantiate member data in the last step. This works most of the time but there are some cases that it fails.

There is a core issue 287 (currently under "review" status) that addresses
this problem. If the proposed resolution for this core issue is accepted,
all of the problem (member with incomplete type, typename handling)
will disappeared. But the template handling will need some overhaul
to comply with the resolution suggested in the core issue. We will
process decls according to the order of declaration in source files,
instead of nested types then member data then ...

--Kriang



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