[Dwarf-discuss] Virtual Methods/Array Of Structs and Anonymous Structs
Lorenzo Gomez
lgomez@windhoverlabs.com
Wed Dec 18 21:25:14 GMT 2024
Thanks so much for the quick response David.
I have reported this as a bug on GCC's bug tracker:
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=118117
I tried it on clang and I don't see the same behavior. So it does seem to
be pointing to an issue in GCC...
Thanks
Lorenzo
On Wed, Dec 18, 2024 at 1:26 PM David Blaikie <dblaikie@gmail.com> wrote:
> This is probably more of a question for the DWARF producer, like GCC, than
> the DWARF workgroup, but let's take a look anyway...
>
> Ah, OK, simplifying things down a bit. You've got this case:
> ```
> struct t1
> {
> typedef struct
> {
> } t2;
>
> #ifdef USE_VIRTUAL
> virtual void f1();
> #endif
> };
>
> t1::t2 v1
> #ifdef USE_ARRAY
> [1]
> #endif
> ;
> ```
> And the observed behavior of GCC is that the type of `v1` is (potentially
> array-of) "t1::(anonymous struct)" if USE_VIRTUAL && USE_ARRAY, and
> otherwise the type is "t1::t2"
>
> Yeah, seems to be the case ( https://godbolt.org/z/c19PrPx83 ). I'd guess
> it's just a minor bug in GCC - seems to still be there today/trunk.
>
> The inconsistency seems to point to it being a bug, and that the expected
> behavior would be that the type is `t1::t2` even if it's an array and t1
> has virtual functions.
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.dwarfstd.org/pipermail/dwarf-discuss/attachments/20241218/101d5711/attachment.htm>
More information about the Dwarf-discuss
mailing list