I initially came across this when testing the new safe C and C++ compiler, Fil-C:
pizlonator/fil-c#37
But it turns out that the issue can be reproduced using only musl:
#include <string>
struct Foo { std::string stderr = "oooh"; } foo;
int main()
{
auto stderr = 42;
foo.stderr = "aaah";
}
Output:
➜ musltest xmake -rv
[ 50%]: cache compiling.release src/main.cpp
/tmp/.xmake1000/250605/zigcc/c++ -c -target x86_64-linux-musl -fvisibility=hidden -fvisibility-inlines-hidden -O3 -Ibuild/.gens/musltest/cross/x86_64/release/platform/windows/idl -DNDEBUG -o build/.objs/musltest/cross/x86_64/release/src/main.cpp.o src/main.cpp
error: src/main.cpp:8:9: error: expected unqualified-id
8 | foo.stderr = "aaah";
| ^
/home/dev/.xmake/packages/z/zig/0.14.0/f5e2b0c8c8b74e00a0ff2ba18c896a4c/lib/libc/include/generic-musl/stdio.h:68:16: note: expanded from macro 'stderr'
68 | #define stderr (stderr)
| ^
1 error generated.