You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
// a.cppm
export module a;
export struct A {
static constexpr int table[] = {43, 44, 45};
};
According to https://eel.is/c++draft/class.static.data#6, the linkage of A::table should be the same with the A, which has external linkage instead of inline linkage. So we should be able to see its definition in a.o. But it is not true:
clang++ -std=c++20 a.cppm -emit-llvm -S -o -
Then we can't see the definition for A::table. It shows we didn't handle the linkage for A::table correctly.
The text was updated successfully, but these errors were encountered:
// a.cppm
export module a;
export struct A {
static constexpr int table[] = {43, 44, 45};
};
According to https://eel.is/c++draft/class.static.data#6, the linkage of A::table should be the same with the A, which has external linkage instead of inline linkage. So we should be able to see its definition in a.o. But it is not true:
clang++ -std=c++20 a.cppm -emit-llvm -S -o -
Then we can't see the definition for A::table. It shows we didn't handle the linkage for A::table correctly.
Wait. This is not a clear problem. I just noticed that there is no inline linkage in the spec. inline linkage is a concept in clang. So we can't explain the spec with the concept in clang. Then while we can say the current behavior doesn't violate the spec, there are some related discussion in itanium-cxx-abi/cxx-abi#170.
See:
According to https://eel.is/c++draft/class.static.data#6, the linkage of
A::table
should be the same with theA
, which has external linkage instead of inline linkage. So we should be able to see its definition ina.o
. But it is not true:Then we can't see the definition for
A::table
. It shows we didn't handle the linkage forA::table
correctly.The text was updated successfully, but these errors were encountered: