[cfe-dev] Bug? This code should be clearly rejected!

David Blaikie dblaikie at gmail.com
Sun Mar 29 16:42:47 PDT 2015


On Sun, Mar 29, 2015 at 3:41 AM, Wilhelm <wilhelm.meier at fh-kl.de> wrote:

> Am 27.03.2015 um 17:15 schrieb David Blaikie:
> >
> >
> > On Fri, Mar 27, 2015 at 3:26 AM, Wilhelm <wilhelm.meier at fh-kl.de
> > <mailto:wilhelm.meier at fh-kl.de>> wrote:
> >
> >     Hi all,
> >
> >     why does this wrong code compile with clang++ 3.6 (g++ rejects it
> >     correctly)?
> >
> >
> > Yep. Looks like a bug to me. I think we had the same bug for return
> > types of abstract classes too & that was fixed a few months ago. Seems
> > we haven't fully flushed out these issues...
>
> Is this already filed as bug? Or fixed in upstream version?
>

The abstract return type one I think was filed/fixed, but I can't find the
specific details.

The abstract parameter type you've described/shown here doesn't seem to be
filed or fixed. If you'd like to file a bug (llvm.org/bugs) that'd be great.

- David


>
> >
> >
> >
> >     class Abc
> >     {
> >     public:
> >         virtual void foo() const = 0;
> >         virtual ~Abc() {}
> >     };
> >     class Impl : public Abc {
> >     public:
> >         void foo() const {}
> >     };
> >     class B
> >     {
> >     public:
> >         void bar(Abc o)
> >         {
> >             o.foo();
> >         }
> >     };
> >     int main()
> >     {
> >         B b;
> >         Impl i;
> >         b.bar(i);
> >     }
> >
> >     --
> >     Wilhelm
> >     _______________________________________________
> >     cfe-dev mailing list
> >     cfe-dev at cs.uiuc.edu <mailto:cfe-dev at cs.uiuc.edu>
> >     http://lists.cs.uiuc.edu/mailman/listinfo/cfe-dev
> >
> >
>
>
> --
> Wilhelm
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/cfe-dev/attachments/20150329/e5f83813/attachment.html>


More information about the cfe-dev mailing list