Author: Kazu Hirata Date: 2022-10-12T19:20:38-07:00 New Revision: be5c65635123b799a2e0bcf77b3b1c68a13bb742
URL: https://github.com/llvm/llvm-project/commit/be5c65635123b799a2e0bcf77b3b1c68a13bb742 DIFF: https://github.com/llvm/llvm-project/commit/be5c65635123b799a2e0bcf77b3b1c68a13bb742.diff LOG: [clang] Use std::underlying_type_t (NFC) Added: Modified: clang/include/clang/Basic/DiagnosticOptions.h clang/lib/Basic/DiagnosticOptions.cpp Removed: ################################################################################ diff --git a/clang/include/clang/Basic/DiagnosticOptions.h b/clang/include/clang/Basic/DiagnosticOptions.h index c4134835b5dec..4b0d45a3ff7c7 100644 --- a/clang/include/clang/Basic/DiagnosticOptions.h +++ b/clang/include/clang/Basic/DiagnosticOptions.h @@ -46,20 +46,20 @@ enum class DiagnosticLevelMask : unsigned { }; inline DiagnosticLevelMask operator~(DiagnosticLevelMask M) { - using UT = std::underlying_type<DiagnosticLevelMask>::type; + using UT = std::underlying_type_t<DiagnosticLevelMask>; return static_cast<DiagnosticLevelMask>(~static_cast<UT>(M)); } inline DiagnosticLevelMask operator|(DiagnosticLevelMask LHS, DiagnosticLevelMask RHS) { - using UT = std::underlying_type<DiagnosticLevelMask>::type; + using UT = std::underlying_type_t<DiagnosticLevelMask>; return static_cast<DiagnosticLevelMask>( static_cast<UT>(LHS) | static_cast<UT>(RHS)); } inline DiagnosticLevelMask operator&(DiagnosticLevelMask LHS, DiagnosticLevelMask RHS) { - using UT = std::underlying_type<DiagnosticLevelMask>::type; + using UT = std::underlying_type_t<DiagnosticLevelMask>; return static_cast<DiagnosticLevelMask>( static_cast<UT>(LHS) & static_cast<UT>(RHS)); } diff --git a/clang/lib/Basic/DiagnosticOptions.cpp b/clang/lib/Basic/DiagnosticOptions.cpp index 68571f2cf94fa..12e47ea0231e1 100644 --- a/clang/lib/Basic/DiagnosticOptions.cpp +++ b/clang/lib/Basic/DiagnosticOptions.cpp @@ -17,7 +17,7 @@ namespace clang { raw_ostream &operator<<(raw_ostream &Out, DiagnosticLevelMask M) { - using UT = std::underlying_type<DiagnosticLevelMask>::type; + using UT = std::underlying_type_t<DiagnosticLevelMask>; return Out << static_cast<UT>(M); } _______________________________________________ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits