This got me pretty recently... TrailingObjects cannot be copied or
moved, since they need to be pre-allocated. This patch deletes the copy
and move operations (plus re-adds the default ctor).
Details
Details
Diff Detail
Diff Detail
- Repository
- rG LLVM Github Monorepo
Event Timeline
Comment Actions
I can imagine there being some cases where these could theoretically be useful.
But if you've tested this change and it doesn't cause build failures with any existing uses of TrailingObjects in llvm-project, then LGTM.
Comment Actions
Thanks! I ran into the problem because I had a function that returned by reference, and stored a copy, which worked silently. Then, during runtime, I obviously got nonsense.
Hopefully these are sufficient to prevent that from being a problem for others in the future. I'd built ahead of time (and done check-all), so I'm quite confident that this won't cause issues.