FS#78366 - [clang] 15.0.7-4 update breaks fmt build

Attached to Project: Arch Linux
Opened by Algunenano (Algunenano) - Tuesday, 02 May 2023, 08:24 GMT
Last edited by Evangelos Foutras (foutrelis) - Tuesday, 02 May 2023, 10:19 GMT
Task Type Bug Report
Category Packages: Extra
Status Closed
Assigned To Evangelos Foutras (foutrelis)
Architecture All
Severity High
Priority Normal
Reported Version
Due in Version Undecided
Due Date Undecided
Percent Complete 100%
Votes 1
Private No

Details

Description:

With the latest changes to clang (https://github.com/archlinux/svntogit-packages/commit/1927ec36313ed919213447a32f213ad0cd438a6c) code that was working fine fails to compile now.

Additional info:
* clang 15.0.7-4
* Install fmt (I'm using a in-tree version, but the one from the repos, 9.1.0-4, can reproduce it too)
* cat a.cpp

```
#include <fmt/format.h>

int main()
{
return 1;
}
```


Try to build a.cpp:

```
$ clang++ --std=c++20 a.cpp
In file included from a.cpp:1:
/usr/include/fmt/format.h:2429:11: error: cannot capture a bit-field by reference
if (sign) *it++ = detail::sign<Char>(sign);
^
/usr/include/fmt/format.h:2370:8: note: 'sign' declared here
auto sign = fspecs.sign;
^
/usr/include/fmt/core.h:2782:10: note: bit-field is declared here
sign_t sign : 8;
^
In file included from a.cpp:1:
/usr/include/fmt/format.h:2443:11: error: cannot capture a bit-field by reference
if (sign) *it++ = detail::sign<Char>(sign);
^
/usr/include/fmt/format.h:2370:8: note: 'sign' declared here
auto sign = fspecs.sign;
^
/usr/include/fmt/core.h:2782:10: note: bit-field is declared here
sign_t sign : 8;
^
In file included from a.cpp:1:
/usr/include/fmt/format.h:2458:9: error: cannot capture a bit-field by reference
if (sign) *it++ = detail::sign<Char>(sign);
^
/usr/include/fmt/format.h:2370:8: note: 'sign' declared here
auto sign = fspecs.sign;
^
/usr/include/fmt/core.h:2782:10: note: bit-field is declared here
sign_t sign : 8;
^
3 errors generated.
```


Reverting to 15.0.7.2 fixes the problem:
```
/tmp $ pacman -Q clang
clang 15.0.7-2
/tmp $ clang++ --std=c++20 a.cpp
/tmp $
```
This task depends upon

Closed by  Evangelos Foutras (foutrelis)
Tuesday, 02 May 2023, 10:19 GMT
Reason for closing:  Fixed
Additional comments about closing:  clang 15.0.7-6

Loading...