On Sun, Aug 01, 2021 at 01:29:16PM +0200, Mark Wielaard wrote: > I added two simple testcases to show the basic support for unions > works now. But there are a couple of things that don't work correctly > for unions yet. In particular when enabling warnings for the new > union.rs testcase you'll get: > > $ gcc/gccrs -Bgcc -g union.rs > union.rs:18:3: warning: field is never read: ‘f1’ > 18 | f1: U, > | ^ > union.rs:19:3: warning: field is never read: ‘f2’ > 19 | f2: V > | ^ > > But those (union) fields in the struct are read. Similarly unused > union fields aren't detected. This is why the testcase uses { dg-options "-w" } to suppress all warnings. Attached is a small followup patch to resolve two FIXMEs to add the correct locus for the Union variant fields (the actual fixme was fixed by Thomas Young in commit 6d7b87f9dd92 "make struct field carry the location info"). But it was missing TupleField and (obviously) Union variants since those weren't implemented yet. Also on https://code.wildebeest.org/git/user/mjw/gccrs/commit/?h=tuple-union-field-locus Cheers, Mark