瀏覽代碼

CM_OVERRIDE: fix feature test for clang

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.
Daniel Pfeifer 9 年之前
父節點
當前提交
3f77655d06
共有 1 個文件被更改,包括 2 次插入0 次删除
  1. 2 0
      Source/Checks/cm_cxx_override.cxx

+ 2 - 0
Source/Checks/cm_cxx_override.cxx

@@ -1,11 +1,13 @@
 struct Foo
 {
+  Foo() {}
   virtual ~Foo() {}
   virtual int test() const = 0;
 };
 
 struct Bar : Foo
 {
+  Bar() {}
   ~Bar() override {}
   int test() const override { return 0; }
 };