[clang] [Clang] Remove redundant check for scoped enums in shift operators (PR #152865)
via cfe-commits
cfe-commits at lists.llvm.org
Sat Aug 9 09:37:55 PDT 2025
llvmbot wrote:
<!--LLVM PR SUMMARY COMMENT-->
@llvm/pr-subscribers-clang
Author: Timothy Choi (tinnamchoi)
<details>
<summary>Changes</summary>
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
---
Full diff: https://github.com/llvm/llvm-project/pull/152865.diff
1 Files Affected:
- (modified) clang/lib/Sema/SemaExpr.cpp (-6)
``````````diff
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."
``````````
</details>
https://github.com/llvm/llvm-project/pull/152865
More information about the cfe-commits
mailing list