[all-commits] [llvm/llvm-project] 8b5503: [Clang] Add diagnostic when scoped enumeration req...

Timothy Choi via All-commits all-commits at lists.llvm.org
Sat Aug 23 02:14:38 PDT 2025


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 8b5503d9b1fca2eb9ceb7439100235ff0e53394b
      https://github.com/llvm/llvm-project/commit/8b5503d9b1fca2eb9ceb7439100235ff0e53394b
  Author: Timothy Choi <101849050+tinnamchoi at users.noreply.github.com>
  Date:   2025-08-23 (Sat, 23 Aug 2025)

  Changed paths:
    M clang/docs/ReleaseNotes.rst
    M clang/include/clang/Basic/DiagnosticSemaKinds.td
    M clang/include/clang/Sema/Sema.h
    M clang/lib/Sema/SemaExpr.cpp
    M clang/test/CXX/over/over.match/over.match.funcs/over.match.oper/p3.cpp
    A clang/test/FixIt/fixit-enum-scoped.cpp
    M clang/test/SemaCXX/enum-scoped.cpp
    M clang/test/SemaCXX/opaque-enum-declaration-in-class-template.cpp

  Log Message:
  -----------
  [Clang] Add diagnostic when scoped enumeration requires an explicit conversion for binary operations (#152698)

```diff
 main.cpp:4:8: error: invalid operands to binary expression ('E' and 'int')
     4 |   E::e + 0;
       |   ~~~~ ^ ~
+main.cpp:4:3: note: no implicit conversion for scoped enum; consider casting to underlying type
+    4 |   E::e + 0;
+      |   ^  
+      |   static_cast<int>( )
```

Resolves #24265



To unsubscribe from these emails, change your notification settings at https://github.com/llvm/llvm-project/settings/notifications


More information about the All-commits mailing list