[PATCH] D101429: PR45879: Use LValue object to evaluate active union members

Serge Pavlov via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Wed Apr 28 00:49:41 PDT 2021


sepavloff created this revision.
sepavloff added a reviewer: rsmith.
sepavloff requested review of this revision.
Herald added a project: clang.

The function HandleUnionActiveMemberChange determined union members that
become active by analyzing LHS expression. It works for assignment
operator but in the case of C++ assignment operator LHS is not easily
available. Actually RHS was used instead, wich resulted in crash
reported in PR45879.

This change uses LValue object to find union members.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D101429

Files:
  clang/lib/AST/ExprConstant.cpp
  clang/test/SemaCXX/constant-expression-cxx2a.cpp

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D101429.341087.patch
Type: text/x-patch
Size: 5045 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20210428/d0a359a4/attachment.bin>


More information about the cfe-commits mailing list