-
Notifications
You must be signed in to change notification settings - Fork 9
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[clang] Bail out when handling union access with virtual inheritance
An assertion issue that arose when handling union member access with virtual base class has been addressed. As pointed out by @zygoloid, there is no need for further derived-to-base analysis in this instance, so we can bail out upon encountering a virtual base class. Minor refinement on the function name as we might not be handling a union. Reported-By: ormris Fixes: llvm/llvm-project#65982 (cherry picked from commit 660876a4019b81b5a7427a3dcec5ce8c39cd1ee0)
- Loading branch information
1 parent
4813589
commit 7ae78be
Showing
2 changed files
with
23 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
// RUN: %clang_cc1 -std=c++20 -verify=cxx20 -triple=x86_64-linux-gnu %s | ||
// Fixes assertion triggered by https://github.com/llvm/llvm-project/issues/65982 | ||
|
||
struct A { int y; }; | ||
struct B : virtual public A {}; | ||
struct X : public B {}; | ||
|
||
void member_with_virtual_inheritance() { | ||
X x; | ||
x.B::y = 1; | ||
} |