Closed
Description
The following valid translation unit
enum e1 {
value = 0
};
enum e2 {
a = 0,
b = e1::value,
c = a + b
};is incorrectly rejected by clang when compiled in C++26 mode with
<source>:8:8: error: invalid arithmetic between different enumeration types ('e2' and 'e1')
8 | c = a + b
| ~ ^ ~
1 error generated.
Compiler returned: 1See it live: https://godbolt.org/z/v4sG9YqMb
In earlier versions of C++, it incorrectly warns saying the conversion is deprecated.
This was accepted in clang 18.1.0, but is failing on current trunk (15e9478).
Activity