================
@@ -0,0 +1,113 @@
+// RUN: %check_clang_tidy -std=c++11-or-later %s
modernize-default-arg-braced-init %t
+
+struct Box {
+ Box() = default;
+ Box(int x) {}
+ Box(const Box&) {}
+};
+
+struct ExplicitBox {
+ explicit ExplicitBox() {}
+};
+
+struct Base {
+ Base() = default;
+};
+
+struct Derived : Base {
+ Derived() = default;
+};
+
+
+
+// Helper function for testing nested calls
+Box makeBox(Box b) { return b; }
+
+// ========== CASES THAT SHOULD TRANSFORM ==========
+
+// Case 1: Basic transformation
+// CHECK-MESSAGES: :[[@LINE+2]]:25: warning: use braced initializer list for
default argument [modernize-default-arg-braced-init]
----------------
zeyi2 wrote:
```suggestion
// CHECK-MESSAGES: :[[@LINE+2]]:25: warning: use braced initializer list for
default argument
```
Same as below.
https://github.com/llvm/llvm-project/pull/203474
_______________________________________________
cfe-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits