Clang doesn't do this immediately because that's not correct:

  struct S {
    S f();
    virtual void g() = 0;
  };

We can't tell that we need to diagnose `f` until we reach the declaration
of `g`.

On Fri, Sep 19, 2014 at 5:04 AM, Robert Matusewicz <[email protected]> wrote:

> Hi rsmith,
>
> Hi,
>
> 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).
>
> 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.
>
> Please, review and provide feedback or propose additional tests.
>
> Thanks in advance
> Robert Matusewicz
>
> http://reviews.llvm.org/D5409
>
> Files:
>   lib/Sema/SemaDecl.cpp
>   test/SemaCXX/abstract.cpp
>
_______________________________________________
cfe-commits mailing list
[email protected]
http://lists.cs.uiuc.edu/mailman/listinfo/cfe-commits

Reply via email to