Skip to content

Commit

Permalink
[clang] Use std::underlying_type_t (NFC)
Browse files Browse the repository at this point in the history
  • Loading branch information
kazutakahirata committed Oct 13, 2022
1 parent 888daa9 commit be5c656
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
6 changes: 3 additions & 3 deletions clang/include/clang/Basic/DiagnosticOptions.h
Expand Up @@ -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));
}
Expand Down
2 changes: 1 addition & 1 deletion clang/lib/Basic/DiagnosticOptions.cpp
Expand Up @@ -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);
}

Expand Down

0 comments on commit be5c656

Please sign in to comment.