[PATCH] D122808: [clang] Fix warnings when `-Wdeprecated-enum-enum-conversion` is enabled

Aaron Ballman via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Apr 5 07:14:24 PDT 2022


aaron.ballman added a comment.

Thanks! This is heading in the right direction. You should also add some test coverage to `llvm/unittests/ADT/STLExtrasTests.cpp` for the new interface.



================
Comment at: llvm/include/llvm/ADT/STLExtras.h:207-211
+template <typename EnumTy1, typename EnumTy2,
+          typename UT1 = std::enable_if_t<std::is_enum_v<EnumTy1>,
+                                          std::underlying_type_t<EnumTy1>>,
+          typename UT2 = std::enable_if_t<std::is_enum_v<EnumTy2>,
+                                          std::underlying_type_t<EnumTy2>>>
----------------
Oops, but `is_enum_v<>` is C++17 and up, and we currently still require only C++14, so this will have to use the long-hand form (precommit CI was failing because of this).


CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D122808/new/

https://reviews.llvm.org/D122808



More information about the llvm-commits mailing list