rnk wrote: This optimization exploits the fact that it's undefined behavior to read from an object after its been destroyed. Given the overall shift in how the industry feels about compilers exploiting undefined behavior, I want to push to add an flag to control this. Think of the people who use `-fno-delete-null-pointer-checks`. The kinds of people who use that are going to want to disable this kind of optimization. This optimization should absolutely be on-by-default, we'd just have a way to opt out, mentioned in release notes, etc etc.
I'd also like to better understand why base classes matter for this annotation. Until very recently, `basic_string` used a bunch of compressed pair empty bases instead of `[[no_unique_address]]`, so adding a base class might create a surprising performance regression with the change as written. https://github.com/llvm/llvm-project/pull/166276 _______________________________________________ cfe-commits mailing list [email protected] https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
