[PATCH] D107378: Make enum iteration with seq safe by default

Jakub Kuderski via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Nov 2 07:13:57 PDT 2021


kuhar added inline comments.


================
Comment at: llvm/include/llvm/ADT/Sequence.h:105-106
+};
+constexpr force_iteration_on_noniterable_enum_t
+    force_iteration_on_noniterable_enum;
+
----------------
aaron.ballman wrote:
> I'm pretty sure this is an ODR violation without also declaring it as `inline` (this definition otherwise has internal linkage).
What's the proper way to do it in the pre-C++17 world? I saw that both `llvm::None` and `std::piecewise_construct` do it the same way.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D107378



More information about the llvm-commits mailing list