-
Notifications
You must be signed in to change notification settings - Fork 13.4k
[Clang][Modules] FE crashes when constructor using-decl are built in header units #134739
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-c-20 Author: Yuxuan Chen (yuxuanchen1997)
When upstream clang has assertion turned on, we crash on the following input:
File: struct relaxed_atomic_base {
relaxed_atomic_base(int) {}
};
struct relaxed_atomic : relaxed_atomic_base {
using relaxed_atomic_base::relaxed_atomic_base; // constructor
}; File: import "RelaxedAtomic.h";
inline void getMaxDeferredReaders() {
static relaxed_atomic cache{0};
} File: import "RelaxedAtomic.h";
struct noncopyable {
noncopyable(const noncopyable&) = delete;
};
struct StaticMetaBase {
relaxed_atomic nextId_{0};
noncopyable ncp;
}; Repro commands:
On the third invocation of clang, we crash with the following back trace:
Note that |
@llvm/issue-subscribers-clang-modules Author: Yuxuan Chen (yuxuanchen1997)
When upstream clang has assertion turned on, we crash on the following input:
File: struct relaxed_atomic_base {
relaxed_atomic_base(int) {}
};
struct relaxed_atomic : relaxed_atomic_base {
using relaxed_atomic_base::relaxed_atomic_base; // constructor
}; File: import "RelaxedAtomic.h";
inline void getMaxDeferredReaders() {
static relaxed_atomic cache{0};
} File: import "RelaxedAtomic.h";
struct noncopyable {
noncopyable(const noncopyable&) = delete;
};
struct StaticMetaBase {
relaxed_atomic nextId_{0};
noncopyable ncp;
}; Repro commands:
On the third invocation of clang, we crash with the following back trace:
Note that |
Maybe related: #105994 but this is fixed in trunk, maybe you can take their godbolt example and produce a godbolt reproducer for this code? |
I am not sure if the godbolt template is going to work for me. The issue arises with header units only. CMake also automatically scans for dependencies, which will make the issue no longer repro here. |
Maybe you can debug for how It may be helpful to investigate if this is a problem in named module and clang modules and if not, to figure out what's the difference. |
I do understand why |
When upstream clang has assertion turned on, we crash on the following input:
File:
RelaxedAtomic.h
File:
SharedMutex.h
File:
ThreadLocalDetail.h
Repro commands:
On the third invocation of clang, we crash with the following back trace:
Note that
ThreadLocalDetail.h
doesn't actually import "SharedMutex.h". If you remove-fmodule-file=SharedMutex.pcm
part this compilation succeeds. I also can't get it to repro when theusing
decl inrelaxed_atomic
is replaced with its own constructor.The text was updated successfully, but these errors were encountered: