Open
Description
Describe the bug
cppfront does not allow to override a function into pure virtual. Whether base type function is pure or not has no impact.
To Reproduce
sample code:
base: type =
{
d: (virtual move this);
f: (virtual this) -> int = 1;
}
derived: type =
{
this: base = ();
f: (override this) -> int;
}
expected result - something like this:
class base
{
public:
virtual ~base() = default;
virtual int f() { return 1; }
};
class derived : public base
{
public:
int f() override = 0;
};
actual result: main.cpp2(10,5): error: a function must have a body ('=' initializer), unless it is virtual (has a 'virtual this' parameter) or is defaultable (operator== or operator<=>)
Command lines
cppfront main.cpp2 -p
, built from commit dc3758a
Additional context
Conflicting documentation - https://hsutter.github.io/cppfront/cpp2/types/ says:
A pure virtual function is a function with a
virtual this
oroverride this
parameter and no body.