[llvm-bugs] [Bug 37645] New: Clang could diagnose failure to construct a pair w/ braced init sequence better

via llvm-bugs llvm-bugs at lists.llvm.org
Thu May 31 18:07:57 PDT 2018


https://bugs.llvm.org/show_bug.cgi?id=37645

            Bug ID: 37645
           Summary: Clang could diagnose failure to construct a pair w/
                    braced init sequence better
           Product: new-bugs
           Version: unspecified
          Hardware: PC
                OS: Linux
            Status: NEW
          Severity: enhancement
          Priority: P
         Component: new bugs
          Assignee: unassignedbugs at nondot.org
          Reporter: chandlerc at gmail.com
                CC: llvm-bugs at lists.llvm.org

Hacking on LLVM I got the following diagnostic:

/home/chandlerc/src/llvm/project/llvm/lib/Transforms/Scalar/SimpleLoopUnswitch.cpp:1932:26:
error: no matching member function for call to 'push_back'
      UnswitchCandidates.push_back({BI, {BI->getCondition()}});
      ~~~~~~~~~~~~~~~~~~~^~~~~~~~~
/home/chandlerc/src/llvm/project/llvm/include/llvm/ADT/SmallVector.h:212:8:
note: candidate function not viable: cannot convert initializer list argument
to 'const std::__1::pair<llvm::TerminatorInst *,
llvm::TinyPtrVector<llvm::Value *> >'
  void push_back(const T &Elt) {
       ^
/home/chandlerc/src/llvm/project/llvm/include/llvm/ADT/SmallVector.h:219:8:
note: candidate function not viable: cannot convert initializer list argument
to 'std::__1::pair<llvm::TerminatorInst *, llvm::TinyPtrVector<llvm::Value *>
>'
  void push_back(T &&Elt) {
       ^

The problem is that TinyPtrVector<T> doesn't have an initializer list
constructor.

-- 
You are receiving this mail because:
You are on the CC list for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-bugs/attachments/20180601/82610bda/attachment-0001.html>


More information about the llvm-bugs mailing list