[PATCH] D133029: [Sema] Allow to diagnose the references to std::vector<T> with incomplete T

Louis Dionne via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Fri Sep 9 06:18:32 PDT 2022


ldionne added a comment.

Just my .02, but I am conflicted between:

1. Simply not doing anything -- the diagnostic users get when they violate the requirement currently is probably not that bad? I did see this breakage a bit in our internal code base as well, but it was easy to fix and there were not many instances.
2. Adding the attribute that was suggested and using it in libc++. On compilers that don't support the attribute, we'd simply be less pedantic.

The one thing I'd rather not do is `static_assert(__is_complete<_Tp>::value)` in all the `std::vector` member functions, IMO that adds complexity and reduces readability for a really marginal gain.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D133029/new/

https://reviews.llvm.org/D133029



More information about the cfe-commits mailing list