------- Additional Comments From SSacek at appsecinc dot com 2005-06-04 19:17
-------
Dear Giovanni Bajo,
Thank you for that detailed explanation. Based on what you said, it sounds
like a complex problem to solve; however, it may not be as difficult as it
first appears. Take the example below, which was already shown to us by
Wolfgang Bangerth. Compile it, and GCC is happy. Then remove the comment from
line 5, and GCC becomes unhappy. Mysterious! With line 5 commented out, GCC
believes that everything is complete. But add line 5 back into the equation,
and GCC believes that things are now incomplete. The Derived structure is in
itself complete too, and judging by this behavior of GCC, my approach to
solving the mystery would be to find out why a class like �struct Base�, which
was once complete, changes its status to incomplete by merely adding
the �Derived� struct. Of course, I�m assuming that the Base struct is being
parsed before the Derived struct.
Understanding the reason why the status change occurs should help in knowing
whether this is an easy or difficult thing to change.
Regards,
-Sid Sacek
struct O {
template<typename T> struct Base {
void set (T, bool=true);
};
// struct Derived : public Base<int> {};
};
void x ()
{
O::Base<int> b;
b.set(1);
}
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=21903