Page MenuHomePhabricator

Adding const overloads of operator* and operator-> for DenseSet iterators
ClosedPublic

Authored by hstefan on Jan 13 2017, 11:19 PM.

Details

Summary

This fixes some problems when building ClangDiagnostics.cpp on Visual Studio 2017 RC. As far as I understand, there was a change in the implementation of the constructor for std::vector with two iterator parameters, which in our case causes an attempt to dereference const Iterator objects. Since there was no overload for a const Iterator, the compile would fail.

Diff Detail

Event Timeline

hstefan updated this revision to Diff 84435.Jan 13 2017, 11:19 PM
hstefan retitled this revision from to Adding const overload of operator* for DenseSet iterators.
hstefan updated this object.
hstefan added reviewers: bkramer, jlebar.
hstefan added a subscriber: llvm-commits.
hstefan retitled this revision from Adding const overload of operator* for DenseSet iterators to Adding const overloads of operator* and operator-> for DenseSet iterators.Jan 13 2017, 11:28 PM
hstefan updated this revision to Diff 84436.Jan 13 2017, 11:36 PM

Now both classes have overloads for operator-> and operator* in a uniform way.

jlebar accepted this revision.Jan 14 2017, 7:48 AM
jlebar edited edge metadata.

You may also want to look at DenseMap's iterator, which at the moment has no non-const overload of operator* and operator-> -- both of these return a non-const reference out of the const operator.

This revision is now accepted and ready to land.Jan 14 2017, 7:48 AM
fhahn updated this revision to Diff 84435.Jan 14 2017, 9:40 AM
fhahn added a subscriber: fhahn.
fhahn updated this revision to Diff 84435.Jan 14 2017, 9:45 AM
fhahn added a comment.Jan 14 2017, 9:52 AM

Sorry for the noise, I'm not sure what I did for Phabricator to think I updated the revision. But it looks like the review still shows the most recent revision.

This revision was automatically updated to reflect the committed changes.