File tree 2 files changed +9
-2
lines changed
2 files changed +9
-2
lines changed Original file line number Diff line number Diff line change @@ -136,8 +136,8 @@ class DenseSetImpl {
136
136
public:
137
137
using difference_type = typename MapTy::const_iterator::difference_type;
138
138
using value_type = ValueT;
139
- using pointer = value_type *;
140
- using reference = value_type &;
139
+ using pointer = const value_type *;
140
+ using reference = const value_type &;
141
141
using iterator_category = std::forward_iterator_tag;
142
142
143
143
ConstIterator () = default ;
Original file line number Diff line number Diff line change @@ -15,6 +15,13 @@ using namespace llvm;
15
15
16
16
namespace {
17
17
18
+ static_assert (std::is_const<std::remove_pointer<
19
+ DenseSet<int >::const_iterator::pointer>::type>::value,
20
+ " Iterator pointer type should be const" );
21
+ static_assert (std::is_const<std::remove_reference<
22
+ DenseSet<int >::const_iterator::reference>::type>::value,
23
+ " Iterator reference type should be const" );
24
+
18
25
// Test hashing with a set of only two entries.
19
26
TEST (DenseSetTest, DoubleEntrySetTest) {
20
27
llvm::DenseSet<unsigned > set (2 );
You can’t perform that action at this time.
0 commit comments