-
Notifications
You must be signed in to change notification settings - Fork 13.1k
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
[clang] Assertion `(!needsOverloadResolutionForCopyConstructor() || (data().DeclaredSpecialMembers & SMF_CopyConstructor)) && "this property has not yet been computed by Sema"' failed. #112909
Comments
@llvm/issue-subscribers-clang-frontend Author: Yihan Yang (yijan4845)
**This testcase is generated by a fuzzer.**
Compiler Explorer: https://godbolt.org/z/orn1Y4799 This invalid code will crash on Clang Assertion Trunk, it seems that this goes back to clang-5: struct foo {
foo(const foo&) = default;
};
struct bar : foo {
virtual bar(const bar&) = default;
}; Stack dump:
|
So if we look at the dump of the class near the crash we have: CXXConstructorDecl 0x102009cb0 <line:5:3, col:35> col:11 invalid bar 'void (const bar &)' default trivial implicit-inline
| `-ParmVarDecl 0x102009b58 <col:15, col:24> col:25 'const bar &'
|-CXXConstructorDecl 0x102009d68 <line:4:8> col:8 implicit invalid constexpr bar 'void (const bar &)' inline default trivial noexcept-unevaluated 0x102009d68
| `-ParmVarDecl 0x102009e60 <col:8> col:8 'const bar &' The constructor is invalid and so maybe in CC @erichkeane sounds reasonable? If so maybe we can label this a good first issue? |
SOMETHING like that sounds reasonable, I'd expect us to bail out on some of those checks sooner if the information they need isn't viable. That said, both are trivial, even though they are invalid, so perhaps we should continue treating them as trivial? It is at least a localized bug, so it isn't an awful first issue for someone. |
Hi! This issue may be a good introductory issue for people new to working on LLVM. If you would like to work on this issue, your first steps are:
If you have any further questions about this issue, don't hesitate to ask via a comment in the thread below. |
@llvm/issue-subscribers-good-first-issue Author: Yihan Yang (yijan4845)
**This testcase is generated by a fuzzer.**
Compiler Explorer: https://godbolt.org/z/orn1Y4799 This invalid code will crash on Clang Assertion Trunk, it seems that this goes back to clang-5: struct foo {
foo(const foo&) = default;
};
struct bar : foo {
virtual bar(const bar&) = default;
}; Stack dump:
|
Could you assign this issue to me? I'd like to take a look. Thanks! |
Fun! I'd like to try fixing this if nobody else is working on it. Please assign if so. |
I feel adding an early validation for invalid constructors in |
This testcase is generated by a fuzzer.
Compiler Explorer: https://godbolt.org/z/orn1Y4799
This invalid code will crash on Clang Assertion Trunk, it seems that this goes back to clang-5:
Stack dump:
The text was updated successfully, but these errors were encountered: