In some build environments, the C++ compiler is unable to infer the
correct type for the DenseMap::insert in isErrorBlock. Typing out
std::make_pair helps.
Details
Details
- Reviewers
bollu Meinersbur efriedma
Diff Detail
Diff Detail
Event Timeline
Comment Actions
The old code works for me with visual studio 2019, but fails with clang 7 and clang 12.1.
[redacted]/polly/lib/Analysis/ScopDetection.cpp:1472:29: error: no matching member function for call to 'insert' auto It = ErrorBlockCache.insert({{&BB, &R}, false}); ~~~~~~~~~~~~~~~~^~~~~~ [redacted]/llvm/include/llvm/ADT/DenseMap.h:207:29: note: candidate function not viable: cannot convert initializer list argument to 'const std::pair<tuple<const BasicBlock *, const Region *>, bool>' std::pair<iterator, bool> insert(const std::pair<KeyT, ValueT> &KV) { ^ [redacted]/llvm/include/llvm/ADT/DenseMap.h:214:29: note: candidate function not viable: cannot convert initializer list argument to 'std::pair<tuple<const BasicBlock *, const Region *>, bool>' std::pair<iterator, bool> insert(std::pair<KeyT, ValueT> &&KV) { ^ [redacted]/llvm/include/llvm/ADT/DenseMap.h:297:8: note: candidate function template not viable: requires 2 arguments, but 1 was provided void insert(InputIt I, InputIt E) { ^