forked from OSchip/llvm-project
Fix a few mismatched iterator types revealed from a libc++ + LLVM_EXPENSIVE_CHECKS build
These were accidental SCARY iterator uses that weren't guaranteed and in libc++'s debug checking mode were actually distinct types. Use decltype to make it easier to keep these things up to date.
This commit is contained in:
parent
7f38812d5b
commit
67a2cc80b6
|
@ -855,8 +855,8 @@ public:
|
|||
|
||||
// Iterators for target-dependent attributes.
|
||||
using td_type = std::pair<std::string, std::string>;
|
||||
using td_iterator = std::map<std::string, std::string>::iterator;
|
||||
using td_const_iterator = std::map<std::string, std::string>::const_iterator;
|
||||
using td_iterator = decltype(TargetDepAttrs)::iterator;
|
||||
using td_const_iterator = decltype(TargetDepAttrs)::const_iterator;
|
||||
using td_range = iterator_range<td_iterator>;
|
||||
using td_const_range = iterator_range<td_const_iterator>;
|
||||
|
||||
|
|
|
@ -80,8 +80,7 @@ public:
|
|||
/// Return a collection of the linked unique remarks to iterate on.
|
||||
/// Ex:
|
||||
/// for (const Remark &R : RL.remarks() { [...] }
|
||||
using iterator =
|
||||
pointee_iterator<std::set<std::unique_ptr<Remark>>::iterator>;
|
||||
using iterator = pointee_iterator<decltype(Remarks)::const_iterator>;
|
||||
|
||||
iterator_range<iterator> remarks() const {
|
||||
return {Remarks.begin(), Remarks.end()};
|
||||
|
|
Loading…
Reference in New Issue