[llvm] ec7e779 - [ADT] Mark variable inline to avoid ODR violations in Sequence.h
Joe Loser via llvm-commits
llvm-commits at lists.llvm.org
Fri Aug 12 11:56:15 PDT 2022
Author: Joe Loser
Date: 2022-08-12T12:55:07-06:00
New Revision: ec7e7797b14d214a1e682d589c3525eebb5e9227
URL: https://github.com/llvm/llvm-project/commit/ec7e7797b14d214a1e682d589c3525eebb5e9227
DIFF: https://github.com/llvm/llvm-project/commit/ec7e7797b14d214a1e682d589c3525eebb5e9227.diff
LOG: [ADT] Mark variable inline to avoid ODR violations in Sequence.h
Mark `force_iteration_on_noniterable_enum` as an `inline` variable
to avoid ODR violations.
Differential Revision: https://reviews.llvm.org/D131777
Added:
Modified:
llvm/include/llvm/ADT/Sequence.h
Removed:
################################################################################
diff --git a/llvm/include/llvm/ADT/Sequence.h b/llvm/include/llvm/ADT/Sequence.h
index fdbf397984d0..96935c291ec1 100644
--- a/llvm/include/llvm/ADT/Sequence.h
+++ b/llvm/include/llvm/ADT/Sequence.h
@@ -104,8 +104,7 @@ struct force_iteration_on_noniterable_enum_t {
explicit force_iteration_on_noniterable_enum_t() = default;
};
-// TODO: Make this `inline` once we update to C++17 to avoid ORD violations.
-constexpr force_iteration_on_noniterable_enum_t
+inline constexpr force_iteration_on_noniterable_enum_t
force_iteration_on_noniterable_enum;
namespace detail {
More information about the llvm-commits
mailing list