[llvm] [llvm][Object] Add missing const qualifier for value_type in content_iterator (PR #124106)
Bushev Dmitry via llvm-commits
llvm-commits at lists.llvm.org
Thu Jan 23 04:13:33 PST 2025
https://github.com/dybv-sc created https://github.com/llvm/llvm-project/pull/124106
value_type was defined as non-const for content_iterator, although it's methods returned a const pointers/references. This prevented it from using in some algorithms from STLExtras.h
>From cc28e552ec79eeb5fce4f0d1bbc3733c378e3aac Mon Sep 17 00:00:00 2001
From: Dmitry Bushev <dmitry.bushev at syntacore.com>
Date: Thu, 23 Jan 2025 15:01:30 +0300
Subject: [PATCH] [llvm][Object] Add missing const qualifier for value_type in
content_iterator.
value_type was defined as non-const for content_iterator, although it's methods
returned a const pointers/references. This prevented it from using in some
algorithms from STLExtras.h
---
llvm/include/llvm/Object/SymbolicFile.h | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/llvm/include/llvm/Object/SymbolicFile.h b/llvm/include/llvm/Object/SymbolicFile.h
index b13588c147d9b2..2c857e72c3e5a6 100644
--- a/llvm/include/llvm/Object/SymbolicFile.h
+++ b/llvm/include/llvm/Object/SymbolicFile.h
@@ -71,7 +71,7 @@ template <class content_type> class content_iterator {
public:
using iterator_category = std::forward_iterator_tag;
- using value_type = content_type;
+ using value_type = const content_type;
using difference_type = std::ptrdiff_t;
using pointer = value_type *;
using reference = value_type &;
More information about the llvm-commits
mailing list