<div dir="ltr">Clang doesn't do this immediately because that's not correct:<div><br></div><div>  struct S {</div><div>    S f();</div><div>    virtual void g() = 0;</div><div>  };</div><div><br></div><div>We can't tell that we need to diagnose `f` until we reach the declaration of `g`.</div></div><div class="gmail_extra"><br><div class="gmail_quote">On Fri, Sep 19, 2014 at 5:04 AM, Robert Matusewicz <span dir="ltr"><<a href="mailto:matekm@gmail.com" target="_blank">matekm@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Hi rsmith,<br>
<br>
Hi,<br>
<br>
Attached patch contains the implementation of a fix for PR18393[1]. According to standard "An abstract class shall not be used as a parameter type, as a function return type, or as the type of an explicit conversion" (class.abstract $10.4.3).<br>
<br>
Currently, checking if type isn't abstract class is done when method is defined, but I don't see any reason why clang shouldn't do it as early as possible, in this case, when function/method is declared. Test also attached.<br>
<br>
Please, review and provide feedback or propose additional tests.<br>
<br>
Thanks in advance<br>
Robert Matusewicz<br>
<br>
<a href="http://reviews.llvm.org/D5409" target="_blank">http://reviews.llvm.org/D5409</a><br>
<br>
Files:<br>
  lib/Sema/SemaDecl.cpp<br>
  test/SemaCXX/abstract.cpp<br>
</blockquote></div><br></div>