cor3ntin added a comment.
Thanks Shafik.
I have some concern about the diagnostics being wonky because, if the init and
field don't match, it's hard to be sure we won't run into simar issues
(although i agree this fixes the crash.)
Also, I'm not saying you should do this but... maybe this thing could be
improved by a sort of `field_iterator` that skips over unnamed bitfield.
================
Comment at: clang/lib/Sema/SemaInit.cpp:2836-2837
continue;
if (*NextField != RD->field_end() &&
declaresSameEntity(*FI, **NextField))
break;
----------------
I think this is probably where it fails produce something sensible to
diagnostics.
in the `*NextField == RD->field_end()` case we just go straight to the end.
In that case, we probably want to break when the previous element is the one
under test, that way you might get to `b`.
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D154675/new/
https://reviews.llvm.org/D154675
_______________________________________________
cfe-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits