This is an archive of the discontinued LLVM Phabricator instance.

Fix incorrect use of std::unique
ClosedPublic

Authored by eugene on Jul 31 2017, 5:29 PM.

Details

Reviewers
zturner
jingham

Diff Detail

Event Timeline

eugene created this revision.Jul 31 2017, 5:29 PM
jingham accepted this revision.Jul 31 2017, 5:47 PM

This bug has been there since the first llvm.org checkin. I'm curious, did it actually cause a problem or did you just see it while reading?

The patch is right. Most of the other uses elide storing the position the non-unique elements got moved to, and does "indexes.erase(std::unique...)" but either form is fine by me.

This revision is now accepted and ready to land.Jul 31 2017, 5:47 PM

clang drew my attention to it:

Symtab.cpp:620:5: warning: ignoring return value of function declared with 'warn_unused_result' attribute [-Wunused-result]

std::unique(indexes.begin(), indexes.end());
^~~~~~~~~~~ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
eugene closed this revision.Jul 31 2017, 6:32 PM

Checked in as r309648