[clang] Bail out when handling union access with virtual inheritance
authorAntonio Frighetto <me@antoniofrighetto.com>
Wed, 13 Sep 2023 16:44:19 +0000 (18:44 +0200)
committerTobias Hieta <tobias@hieta.se>
Wed, 27 Sep 2023 15:53:03 +0000 (17:53 +0200)
commit5f1fcc43e592871b3860760a4bed56cf1be5772f
tree8e0f9e61d9c9e3bbc7038af4af9b0263dee85511
parent178cf5bc8732a010f02e9a262f08afc549a1bc1d
[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: https://github.com/llvm/llvm-project/issues/65982
(cherry picked from commit 660876a4019b81b5a7427a3dcec5ce8c39cd1ee0)
clang/lib/AST/ExprConstant.cpp
clang/test/SemaCXX/cxx2a-virtual-base-used.cpp [new file with mode: 0644]