[PATCH] D94599: [clang][Tooling] Get rid of a hack in SymbolOccurrences, NFCI

Simon Tatham via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Tue Jan 19 03:58:41 PST 2021


simon_tatham added inline comments.


================
Comment at: clang/include/clang/Tooling/Refactoring/Rename/SymbolOccurrences.h:81
+  union {
+    SourceRange SingleRange;
+    unsigned NumRanges;
----------------
This surely relies on `SourceRange` having no destructor (or rather, a trivial one). If that ever changes, then destruction of this class will risk either a spurious call to the destructor or a missing one.

Is there any way to somehow arrange that a build failure will occur if the definition of `SourceRange` changes in that way?


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D94599



More information about the cfe-commits mailing list