[clang] [Clang] Remove redundant check for scoped enums in shift operators (PR #152865)
Timothy Choi via cfe-commits
cfe-commits at lists.llvm.org
Sat Aug 9 09:37:04 PDT 2025
https://github.com/tinnamchoi created https://github.com/llvm/llvm-project/pull/152865
This check, introduced in 0bf3140424a0a13a928a4e6bf0f112e6167a5636, has not been necessary since 21673c4e7ec08457b53798b9879b7cc9a5909eb8
https://github.com/llvm/llvm-project/blob/0bf3140424a0a13a928a4e6bf0f112e6167a5636/clang/lib/Sema/SemaExpr.cpp#L5432-L5442
https://github.com/llvm/llvm-project/blob/21673c4e7ec08457b53798b9879b7cc9a5909eb8/clang/lib/AST/Type.cpp#L513-L529
>From fc0a4c73dc2abb74f200619d78f9b0baab1de7b7 Mon Sep 17 00:00:00 2001
From: tinnamchoi <tinnam.choi at gmail.com>
Date: Sat, 9 Aug 2025 12:02:43 +0800
Subject: [PATCH] [Clang] Remove redundant check for scoped enums in shift
operators
This check, introduced in 0bf3140424a0a13a928a4e6bf0f112e6167a5636, has not been necessary since 21673c4e7ec08457b53798b9879b7cc9a5909eb8
---
clang/lib/Sema/SemaExpr.cpp | 6 ------
1 file changed, 6 deletions(-)
diff --git a/clang/lib/Sema/SemaExpr.cpp b/clang/lib/Sema/SemaExpr.cpp
index 6793d6da85cb1..c805ef205beba 100644
--- a/clang/lib/Sema/SemaExpr.cpp
+++ b/clang/lib/Sema/SemaExpr.cpp
@@ -11747,12 +11747,6 @@ QualType Sema::CheckShiftOperands(ExprResult &LHS, ExprResult &RHS,
!RHSType->hasIntegerRepresentation())
return InvalidOperands(Loc, LHS, RHS);
- // C++0x: Don't allow scoped enums. FIXME: Use something better than
- // hasIntegerRepresentation() above instead of this.
- if (isScopedEnumerationType(LHSType) ||
- isScopedEnumerationType(RHSType)) {
- return InvalidOperands(Loc, LHS, RHS);
- }
DiagnoseBadShiftValues(*this, LHS, RHS, Loc, Opc, LHSType);
// "The type of the result is that of the promoted left operand."
More information about the cfe-commits
mailing list