[clang] [Clang][NFC] Improve testing for the flexible array member (PR #89462)

2024-04-19 Thread Bill Wendling via cfe-commits
bwendling wrote: > Strictly speaking, I don't think this is NFC. Consider, for example: > > ``` > struct S { > struct X { int array[1]; } x; > struct Y { int count; int array[] __attribute__((__counted_by__(count))); } > y; > }; > void f(void* __attribute__((pass_dynamic_object_size(0;

[clang] [Clang][NFC] Improve testing for the flexible array member (PR #89462)

2024-04-19 Thread Eli Friedman via cfe-commits
efriedma-quic wrote: Strictly speaking, I don't think this is NFC. Consider, for example: ``` struct S { struct X { int array[1]; } x; struct Y { int count; int array[] __attribute__((__counted_by__(count))); } y; }; void f(void* __attribute__((pass_dynamic_object_size(0; void g(struct

[clang] [Clang][NFC] Improve testing for the flexible array member (PR #89462)

2024-04-19 Thread Bill Wendling via cfe-commits
bwendling wrote: > Does this still work for cases where there are multiple flexible arrays? e.g. > > ``` > struct weird_protocol { > unsigned int cmd_type; > unsigned int data_len; > union { > struct cmd_one one[]; > struct cmd_two two[]; > struct cmd_three th

[clang] [Clang][NFC] Improve testing for the flexible array member (PR #89462)

2024-04-19 Thread Kees Cook via cfe-commits
kees wrote: Does this still work for cases where there are multiple flexible arrays? e.g. ``` struct weird_protocol { unsigned int cmd_type; unsigned int data_len; union { struct cmd_one one[]; struct cmd_two two[]; struct cmd_three three[]; unsigned c

[clang] [Clang][NFC] Improve testing for the flexible array member (PR #89462)

2024-04-19 Thread via cfe-commits
llvmbot wrote: @llvm/pr-subscribers-clang @llvm/pr-subscribers-clang-codegen Author: Bill Wendling (bwendling) Changes Testing for the name of the flexible array member isn't as robust as testing the FieldDecl pointers. --- Full diff: https://github.com/llvm/llvm-project/pull/89462.diff

[clang] [Clang][NFC] Improve testing for the flexible array member (PR #89462)

2024-04-19 Thread Bill Wendling via cfe-commits
https://github.com/bwendling created https://github.com/llvm/llvm-project/pull/89462 Testing for the name of the flexible array member isn't as robust as testing the FieldDecl pointers. >From 2a6b3356a977132459bed84fb4e4add631e181cb Mon Sep 17 00:00:00 2001 From: Bill Wendling Date: Fri, 19 A