-
Notifications
You must be signed in to change notification settings - Fork 11.9k
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] Fix Microsoft ABI inheritance model when member pointer is used in a base specifier #91990
base: main
Are you sure you want to change the base?
Changes from 3 commits
5dc9193
85a823a
f343670
ff6a2b8
66c8658
7058fb4
7c619ab
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -215,6 +215,14 @@ struct NewUnspecified; | |
SingleTemplate<void (IncSingle::*)()> tmpl_single; | ||
UnspecTemplate<void (NewUnspecified::*)()> tmpl_unspec; | ||
|
||
// Member pointers used in base specifiers force an unspecified inheritance model | ||
struct MemPtrInBase : UnspecTemplate<void (MemPtrInBase::*)()> {}; | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I guess this memptr type is not required to be complete during the parsing of the base specifiers here. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. It's not for simply naming the type for the template argument but There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Yes, but it's not clear to me if that happens before or after we've finished parsing the base specifiers. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I see what you mean. However, they need to be instantiated at least before the body of the struct is parsed (because the bases affect name lookup), and this is essentially the same time as when you are "parsing the base specifiers". |
||
#ifdef VMB | ||
struct __single_inheritance SpecifiedMemPtrInBase; | ||
struct SpecifiedMemPtrInBase : SingleTemplate<void (SpecifiedMemPtrInBase::*)()> {}; | ||
struct __single_inheritance SpecifiedMemPtrInBase2 : SingleTemplate<void (SpecifiedMemPtrInBase2::*)()> {}; | ||
#endif | ||
|
||
struct NewUnspecified { }; | ||
|
||
static_assert(sizeof(void (NewUnspecified::*)()) == kUnspecifiedFunctionSize, ""); | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I am surprised clang-format didn't complain about starting with a lowercase for variables.
I can't think of a better name. I respond here if I do :).