This is the mail archive of the
mailing list for the GCC project.
Re: PATCH: Implement __attribute__((final)) for C++, restricting subtyping and overriding
On 10/14/08, Jeffrey Yasskin <email@example.com> wrote:
> On Oct 10, 2008, Jeffrey Yasskin <firstname.lastname@example.org> wrote:
> > On Oct 10, 2008, Doug Gregor <email@example.com> wrote:
> > > Does this implement exactly the behavior required for the
> > > "final" attribute that just went into C++0x?
> > >
> > > http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2008/n2761.pdf
> > I think it implements the same behavior on virtual functions,
> > but may be different on classes.
> On the other hand, N2761 says, "A class with the final attribute
> will not be allowed to be a base class for another class." which
> conflicts with the wording it actually added to the standard. I'm
> submitting a defect report through Lawrence Crowl, and, given
> that sentence, I think the my patch does implement what N2761's
> authors intended. Does anyone have any comments/suggestions about
> the patch?
I support Jeffrey's approach. It is the more conservative
interpretation. We can relax the rules later without affecting
any user code.