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

Wilhelm wilhelm.meier at fh-kl.de
Mon Mar 30 02:12:51 PDT 2015


Am 30.03.2015 um 01:42 schrieb David Blaikie:
> 
> 
> On Sun, Mar 29, 2015 at 3:41 AM, Wilhelm <wilhelm.meier at fh-kl.de
> <mailto: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>
>     > <mailto: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
> <http://llvm.org/bugs>) that'd be great.

Ok, just filed a new bug ...

> 
> - 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>
>     <mailto:cfe-dev at cs.uiuc.edu <mailto:cfe-dev at cs.uiuc.edu>>
>     >     http://lists.cs.uiuc.edu/mailman/listinfo/cfe-dev
>     >
>     >
> 
> 
>     --
>     Wilhelm
> 
> 


-- 
Wilhelm



More information about the cfe-dev mailing list