[clang] [Sema] Fix handling of fields with initializers in nested anonymous unions. (PR #91692)

2024-06-04 Thread Eli Friedman via cfe-commits
https://github.com/efriedma-quic closed https://github.com/llvm/llvm-project/pull/91692 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [Sema] Fix handling of fields with initializers in nested anonymous unions. (PR #91692)

2024-06-03 Thread Eli Friedman via cfe-commits
https://github.com/efriedma-quic updated https://github.com/llvm/llvm-project/pull/91692 >From 6123b5f43b11f968474baa15623c4bf4d14ed188 Mon Sep 17 00:00:00 2001 From: Eli Friedman Date: Thu, 9 May 2024 19:40:46 -0700 Subject: [PATCH] [Sema] Fix handling of fields with initializers in nested

[clang] [Sema] Fix handling of fields with initializers in nested anonymous unions. (PR #91692)

2024-06-03 Thread Eli Friedman via cfe-commits
https://github.com/efriedma-quic updated https://github.com/llvm/llvm-project/pull/91692 >From 2e442967c20b930788ac0818b4ce10daf2792f91 Mon Sep 17 00:00:00 2001 From: Eli Friedman Date: Thu, 9 May 2024 19:40:46 -0700 Subject: [PATCH] [Sema] Fix handling of fields with initializers in nested

[clang] [Sema] Fix handling of fields with initializers in nested anonymous unions. (PR #91692)

2024-06-03 Thread Richard Smith via cfe-commits
@@ -77,3 +77,38 @@ namespace use_self { int fib(int n) { return FibTree{n}.v; } } + +namespace nested_union { + union Test1 { +union { + int inner { 42 }; +}; +int outer; + }; + static_assert(Test1{}.inner == 42, ""); + struct Test2 { +union { +

[clang] [Sema] Fix handling of fields with initializers in nested anonymous unions. (PR #91692)

2024-06-03 Thread Richard Smith via cfe-commits
https://github.com/zygoloid approved this pull request. Looks good to me too. https://github.com/llvm/llvm-project/pull/91692 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [Sema] Fix handling of fields with initializers in nested anonymous unions. (PR #91692)

2024-06-03 Thread Richard Smith via cfe-commits
@@ -77,3 +77,38 @@ namespace use_self { int fib(int n) { return FibTree{n}.v; } } + +namespace nested_union { + union Test1 { +union { + int inner { 42 }; +}; +int outer; + }; + static_assert(Test1{}.inner == 42, ""); + struct Test2 { +union { +

[clang] [Sema] Fix handling of fields with initializers in nested anonymous unions. (PR #91692)

2024-06-03 Thread Richard Smith via cfe-commits
https://github.com/zygoloid edited https://github.com/llvm/llvm-project/pull/91692 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [Sema] Fix handling of fields with initializers in nested anonymous unions. (PR #91692)

2024-06-03 Thread Eli Friedman via cfe-commits
efriedma-quic wrote: Ping https://github.com/llvm/llvm-project/pull/91692 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [Sema] Fix handling of fields with initializers in nested anonymous unions. (PR #91692)

2024-05-10 Thread Vlad Serebrennikov via cfe-commits
https://github.com/Endilll approved this pull request. LGTM, but someone else should take a look as well. https://github.com/llvm/llvm-project/pull/91692 ___ cfe-commits mailing list cfe-commits@lists.llvm.org

[clang] [Sema] Fix handling of fields with initializers in nested anonymous unions. (PR #91692)

2024-05-09 Thread via cfe-commits
github-actions[bot] wrote: :warning: C/C++ code formatter, clang-format found issues in your code. :warning: You can test this locally with the following command: ``bash git-clang-format --diff 7115ed0fff027b65fa76fdfae215ed1382ed1473 44c9e4b9920ab23db93a8a716695a6e712edcf01 --

[clang] [Sema] Fix handling of fields with initializers in nested anonymous unions. (PR #91692)

2024-05-09 Thread via cfe-commits
llvmbot wrote: @llvm/pr-subscribers-clang Author: Eli Friedman (efriedma-quic) Changes Make sure we count the anonymous union as an initialized field, so we properly construct the AST. Included bonus testcase Test3, which shows a remaining gap: an anonymous union can contain a

[clang] [Sema] Fix handling of fields with initializers in nested anonymous unions. (PR #91692)

2024-05-09 Thread Eli Friedman via cfe-commits
https://github.com/efriedma-quic created https://github.com/llvm/llvm-project/pull/91692 Make sure we count the anonymous union as an initialized field, so we properly construct the AST. Included bonus testcase Test3, which shows a remaining gap: an anonymous union can contain a partially