mirror of
https://github.com/reactos/CMake.git
synced 2025-01-23 03:58:02 +00:00
3f77655d06
Clang refuses to default initialize an instance of a class that does not have a default constructor. Fix the check by adding default constructors. Don't use brace initialization like it is proposed in the error message. We want to test the override support independent from the support for brace initialization.
25 lines
280 B
C++
25 lines
280 B
C++
struct Foo
|
|
{
|
|
Foo() {}
|
|
virtual ~Foo() {}
|
|
virtual int test() const = 0;
|
|
};
|
|
|
|
struct Bar : Foo
|
|
{
|
|
Bar() {}
|
|
~Bar() override {}
|
|
int test() const override { return 0; }
|
|
};
|
|
|
|
int test(Foo const& foo)
|
|
{
|
|
return foo.test();
|
|
}
|
|
|
|
int main()
|
|
{
|
|
Bar const bar;
|
|
return test(bar);
|
|
}
|