[mlir] Fix warning `missing base in copy ctor`
authorJaved Absar <javeda@graphcore.ai>
Mon, 23 May 2022 13:48:57 +0000 (14:48 +0100)
committerJaved Absar <javeda@graphcore.ai>
Wed, 25 May 2022 09:24:00 +0000 (10:24 +0100)
This suppresse annoying warning when building mlir.
```
 warning: base class ‘class mlir::PassWrapper<{anonymous}::TestStatisticPass,
  mlir::OperationPass<void> >’ should be explicitly initialized in the copy constructor [-Wextra]
```

Reviewed By: rriddle

Differential Revision: https://reviews.llvm.org/D126209

mlir/test/lib/Pass/TestPassManager.cpp

index c19221d..a61cfac 100644 (file)
@@ -62,7 +62,7 @@ struct TestOptionsPass
                                      llvm::cl::desc("Example string option")};
   };
   TestOptionsPass() = default;
-  TestOptionsPass(const TestOptionsPass &) {}
+  TestOptionsPass(const TestOptionsPass &) : PassWrapper() {}
   TestOptionsPass(const Options &options) {
     listOption = options.listOption;
     stringOption = options.stringOption;
@@ -168,7 +168,7 @@ struct TestStatisticPass
   MLIR_DEFINE_EXPLICIT_INTERNAL_INLINE_TYPE_ID(TestStatisticPass)
 
   TestStatisticPass() = default;
-  TestStatisticPass(const TestStatisticPass &) {}
+  TestStatisticPass(const TestStatisticPass &) : PassWrapper() {}
   StringRef getArgument() const final { return "test-stats-pass"; }
   StringRef getDescription() const final { return "Test pass statistics"; }