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: PATCH: Implement __attribute__((final)) for C++, restricting subtyping and overriding


On 10/14/08, Jeffrey Yasskin <jyasskin@gmail.com> wrote:
> On Oct 10, 2008, Jeffrey Yasskin <jyasskin@gmail.com> wrote:
> > On Oct 10, 2008, Doug Gregor <doug.gregor@gmail.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.

-- 
Lawrence Crowl


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