https://gcc.gnu.org/bugzilla/show_bug.cgi?id=86252

            Bug ID: 86252
           Summary: Abstract class in function return type
           Product: gcc
           Version: unknown
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c++
          Assignee: unassigned at gcc dot gnu.org
          Reporter: zhonghao at pku dot org.cn
  Target Milestone: ---

The code is as follow:

template<typename T>
struct S{};

struct A
{
 virtual void f() = 0;
};

int main()
{
 S<A(int)> s;
}

An abstract class shall not be used as a function return type, but clang++
accepts the code. 

The code comes from a gcc bug report
(https://gcc.gnu.org/bugzilla/show_bug.cgi?id=51184).

I reported the problem to clang: https://bugs.llvm.org/show_bug.cgi?id=37833

Richard Smith told me that the language rule changed recently.

Will g++ catch up the so-called rule change?

Reply via email to