-
Notifications
You must be signed in to change notification settings - Fork 13.4k
"Definition with same mangled name as another definition" error when compiling C++20 Modules #118137
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
@llvm/issue-subscribers-clang-modules Author: Mikail Bagishov (MikailBag)
My code: https://gist.github.com/MikailBag/5803041040c052deda1d06893eae67e1
(Please note that is requires stdexec, which is AFAIK reference implementation of the C++26 `std::execution`)
When running
I'm not an experienced modules user, so I can easily be wrong, but I don't see anything wrong in terms of linkage/ODR/etc. And based on #53232 it seems, that this error is in fact internal to compiler. Here is compiler version (it was installed from the LLVM APT repository):
|
Well, I've tried to investigate this problem a bit more, and situation got more interesting. I've compiled clang from sources, here is version info (some fresh commit + release build + assertions):
According to git status & git diff, this is a clean build. With that, I get following results:
Full error message https://gist.github.com/MikailBag/d2f109fc923a72e15c3568aa6faed917 I can attach generated reproducer script and preprocessed source, but they depent upon BMIs, so it feels useless. To be clear: I have no idea whether or how this assertion failure relates to the ODR/mangling issue above. |
I suspect this is duplicated with #119947 Can you try to verify? |
Error messages are similar, anonymous namespaced are involved too, so this may easily be the case.
Could you, please, clarify how can I do it? If you want to postpone this issue until 119947 is resolved, then I think I have no objections (since there is no evidence that these two issues are different). With that said, I have two somewhat related questions:
|
If we can't reduce it, maybe we don't have good method to judge if it is the same issue precisely. So I prefer to postpone this until #119947 is solved. |
My code: https://gist.github.com/MikailBag/5803041040c052deda1d06893eae67e1
(Please note that is requires stdexec, which is AFAIK reference implementation of the C++26
std::execution
)When running
build.sh
, I get following error:I'm not an experienced modules user, so I can easily be wrong, but I don't see anything wrong in terms of linkage/ODR/etc. And based on #53232 it seems, that this error is in fact internal to compiler.
Here is compiler version (it was installed from the LLVM APT repository):
The text was updated successfully, but these errors were encountered: