-
Notifications
You must be signed in to change notification settings - Fork 787
[SYCL] IsDerivedFromInclusive expects a compelete type in the presence of attribute add_ir_attributes_global_variable. #15897
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
Changes from all commits
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 |
---|---|---|
|
@@ -301,6 +301,7 @@ static AccessResult IsDerivedFromInclusive(const CXXRecordDecl *Derived, | |
const CXXRecordDecl *Target) { | ||
assert(Derived->getCanonicalDecl() == Derived); | ||
assert(Target->getCanonicalDecl() == Target); | ||
assert(Derived->getDefinition() && "Expecting a complete type"); | ||
|
||
if (Derived == Target) return AR_accessible; | ||
|
||
|
@@ -776,6 +777,8 @@ static AccessResult HasAccess(Sema &S, | |
// [B3] and [M3] | ||
} else { | ||
assert(Access == AS_protected); | ||
if (!ECRecord->getDefinition()) | ||
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. Should these changes be made in community clang? This doesn't seem SYCL specific 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 have tried but I there is no upstream class attribute that accepts an arbitrary expression. Couldn't find a test case that crashes. The closest one I could find is https://godbolt.org/z/qxEjjvf73 , but it doesn't crash. It returns the expected error. 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. When is 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.
This function is checking if the entity is accessible with the specific
Please see comments at line 858 concerning [M3] and [B3]. 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. 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. Thanks for explaining. |
||
continue; | ||
switch (IsDerivedFromInclusive(ECRecord, NamingClass)) { | ||
case AR_accessible: break; | ||
case AR_inaccessible: continue; | ||
|
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 guess this is because types need to be complete to determine inheritance hierarchy? @AaronBallman can you confirm this?
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.
That's correct.