================
@@ -0,0 +1,55 @@
+// RUN: %check_clang_tidy -check-suffixes=IGNORE -std=c++23-or-later %s \
+// RUN: modernize-use-to-underlying %t -- \
+// RUN: -config="{CheckOptions: {modernize-use-to-underlying.ImpreciseCasts:
Ignore}}"
+// RUN: %check_clang_tidy -check-suffixes=WARN -std=c++23-or-later %s \
+// RUN: modernize-use-to-underlying %t -- \
+// RUN: -config="{CheckOptions: {modernize-use-to-underlying.ImpreciseCasts:
Warn}}"
+// RUN: %check_clang_tidy -check-suffixes=PRESERVE -std=c++23-or-later %s \
+// RUN: modernize-use-to-underlying %t -- \
+// RUN: -config="{CheckOptions: {modernize-use-to-underlying.ImpreciseCasts:
PreserveType}}"
+// RUN: %check_clang_tidy -check-suffixes=UNDERLYING -std=c++23-or-later %s \
+// RUN: modernize-use-to-underlying %t -- \
+// RUN: -config="{CheckOptions: {modernize-use-to-underlying.ImpreciseCasts:
UseUnderlyingType}}"
+
+// CHECK-FIXES-WARN: #include <utility>
+// CHECK-FIXES-PRESERVE: #include <utility>
+// CHECK-FIXES-UNDERLYING: #include <utility>
+
+namespace std {
+template <typename T>
+constexpr __underlying_type(T) to_underlying(T value) noexcept {
+ return static_cast<__underlying_type(T)>(value);
+}
+} // namespace std
----------------
zwuis wrote:
Move this to
`clang-tools-extra/test/clang-tidy/checkers/Inputs/Headers/std/utility`.
https://github.com/llvm/llvm-project/pull/210459
_______________________________________________
cfe-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits