I was wondering that according to the C ++ standard, the following was completed:
struct Abstract { virtual ~Abstract() = 0; }; auto get_type() -> Abstract; // I use `get_type` only to extract the return type. using MyType = decltype(get_type());
GCC 6.3 accepts it, but Clang 3.9 rejects it.
However, if I do this:
auto get_type() -> struct Abstract; struct Abstract { virtual ~Abstract() = 0; }; using MyType = decltype(get_type());
Now both compilers accept it. Are they both wrong in this case?
c ++ language-lawyer abstract-class c ++ 11
Guillaume racicot
source share