<div dir="ltr"><br><div class="gmail_extra"><br><div class="gmail_quote">On Fri, Mar 27, 2015 at 3:26 AM, Wilhelm <span dir="ltr"><<a href="mailto:wilhelm.meier@fh-kl.de" target="_blank">wilhelm.meier@fh-kl.de</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Hi all,<br>
<br>
why does this wrong code compile with clang++ 3.6 (g++ rejects it<br>
correctly)?<br></blockquote><div><br>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... <br> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<br>
class Abc<br>
{<br>
public:<br>
    virtual void foo() const = 0;<br>
    virtual ~Abc() {}<br>
};<br>
class Impl : public Abc {<br>
public:<br>
    void foo() const {}<br>
};<br>
class B<br>
{<br>
public:<br>
    void bar(Abc o)<br>
    {<br>
        o.foo();<br>
    }<br>
};<br>
int main()<br>
{<br>
    B b;<br>
    Impl i;<br>
    b.bar(i);<br>
}<br>
<span class="HOEnZb"><font color="#888888"><br>
--<br>
Wilhelm<br>
_______________________________________________<br>
cfe-dev mailing list<br>
<a href="mailto:cfe-dev@cs.uiuc.edu">cfe-dev@cs.uiuc.edu</a><br>
<a href="http://lists.cs.uiuc.edu/mailman/listinfo/cfe-dev" target="_blank">http://lists.cs.uiuc.edu/mailman/listinfo/cfe-dev</a><br>
</font></span></blockquote></div><br></div></div>