[clang] [Clang][Sema] Fix missing warning when comparing mismatched enums in … (PR #81418)

Erich Keane via cfe-commits cfe-commits at lists.llvm.org
Fri Feb 23 12:58:24 PST 2024


================
@@ -4097,6 +4105,13 @@ FieldDecl *Expr::getSourceBitField() {
   return nullptr;
 }
 
+EnumConstantDecl *Expr::getEnumConstantDecl() {
+  Expr *E = this->IgnoreParenImpCasts();
+  if (DeclRefExpr *DRE = dyn_cast<DeclRefExpr>(E))
----------------
erichkeane wrote:

```suggestion
  if (auto *DRE = dyn_cast<DeclRefExpr>(E))
```

https://github.com/llvm/llvm-project/pull/81418


More information about the cfe-commits mailing list