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.c...@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."

_______________________________________________
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to