[clang] [clang-tools-extra] [clang-tidy] Add new check `modernize-use-designated-initializers` (PR #80541)

Piotr Zegar via cfe-commits cfe-commits at lists.llvm.org
Tue Feb 13 13:17:47 PST 2024


Danny =?utf-8?q?Mösch?= <danny.moesch at icloud.com>,
Danny =?utf-8?q?Mösch?= <danny.moesch at icloud.com>,
Danny =?utf-8?q?Mösch?= <danny.moesch at icloud.com>,
Danny =?utf-8?q?Mösch?= <danny.moesch at icloud.com>,
Danny =?utf-8?q?Mösch?= <danny.moesch at icloud.com>,
Danny =?utf-8?q?Mösch?= <danny.moesch at icloud.com>,
Danny =?utf-8?q?Mösch?= <danny.moesch at icloud.com>,
Danny =?utf-8?q?Mösch?= <danny.moesch at icloud.com>,
Danny =?utf-8?q?Mösch?= <danny.moesch at icloud.com>,
Danny =?utf-8?q?Mösch?= <danny.moesch at icloud.com>,
Danny =?utf-8?q?Mösch?= <danny.moesch at icloud.com>,
Danny =?utf-8?q?Mösch?= <danny.moesch at icloud.com>,
Danny =?utf-8?q?Mösch?= <danny.moesch at icloud.com>,
Danny =?utf-8?q?Mösch?= <danny.moesch at icloud.com>,
Danny =?utf-8?q?Mösch?= <danny.moesch at icloud.com>,
Danny =?utf-8?q?Mösch?= <danny.moesch at icloud.com>,
Danny =?utf-8?q?Mösch?= <danny.moesch at icloud.com>,
Danny =?utf-8?q?Mösch?= <danny.moesch at icloud.com>,
Danny =?utf-8?q?Mösch?= <danny.moesch at icloud.com>,
Danny =?utf-8?q?Mösch?= <danny.moesch at icloud.com>,
Danny =?utf-8?q?Mösch?= <danny.moesch at icloud.com>,
Danny =?utf-8?q?Mösch?= <danny.moesch at icloud.com>,
Danny =?utf-8?q?Mösch?= <danny.moesch at icloud.com>,
Danny =?utf-8?q?Mösch?= <danny.moesch at icloud.com>,
Danny =?utf-8?q?Mösch?= <danny.moesch at icloud.com>,
Danny =?utf-8?q?Mösch?= <danny.moesch at icloud.com>,
Danny =?utf-8?q?Mösch?= <danny.moesch at icloud.com>,
Danny =?utf-8?q?Mösch?= <danny.moesch at icloud.com>
Message-ID:
In-Reply-To: <llvm.org/llvm/llvm-project/pull/80541 at github.com>


================
@@ -0,0 +1,130 @@
+// RUN: %check_clang_tidy -std=c++17 %s modernize-use-designated-initializers %t
+// RUN: %check_clang_tidy -check-suffixes=,SINGLE-ELEMENT -std=c++17 %s modernize-use-designated-initializers %t \
+// RUN:     -- -config="{CheckOptions: [{key: modernize-use-designated-initializers.IgnoreSingleElementAggregates, value: false}]}" \
+// RUN:     --
+// RUN: %check_clang_tidy -check-suffixes=POD -std=c++17 %s modernize-use-designated-initializers %t \
+// RUN:     -- -config="{CheckOptions: [{key: modernize-use-designated-initializers.RestrictToPODTypes, value: true}]}" \
+// RUN:     --
+
+struct S1 {};
+
----------------
PiotrZSL wrote:

Support for macros is needed, tests where value is behind macro, or entire variable is behind macro.
Consider implementing option IgnoreMacros, like in other checks.

https://github.com/llvm/llvm-project/pull/80541


More information about the cfe-commits mailing list