https://gcc.gnu.org/bugzilla/show_bug.cgi?id=94058

--- Comment #5 from Mital Ashok <mital at mitalashok dot co.uk> ---
Proposed patch doesn't seem to work with bool bit-fields (with width not-1):

```
struct X {
  bool bf : 8;
} x;
signed char x_not_narrow{ x.bf };
```

Currently: Not narrowing
With patch:

```
test.cpp:4:29: warning: narrowing conversion of ‘(bool)x.X::bf’ from ‘unsigned
char’ to ‘signed char’ [-Wnarrowing]
    4 | signed char x_not_narrow{ x.bf };
      |                           ~~^~
```

This DR shouldn't affect this case since this is not a conversion "from an
integer type or unscoped enumeration type to an integer type that cannot
represent all the values of the original type" (bool -> signed char), so the
new exception shouldn't be checked.

Reply via email to