[LLVMbugs] [Bug 23658] New: List-initialization not considering conversions

bugzilla-daemon at llvm.org bugzilla-daemon at llvm.org
Tue May 26 08:16:49 PDT 2015


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

            Bug ID: 23658
           Summary: List-initialization not considering conversions
           Product: clang
           Version: 3.6
          Hardware: PC
                OS: Windows NT
            Status: NEW
          Severity: normal
          Priority: P
         Component: C++11
          Assignee: unassignedclangbugs at nondot.org
          Reporter: barry.revzin at gmail.com
                CC: dgregor at apple.com, llvmbugs at cs.uiuc.edu
    Classification: Unclassified

Consider the following program:

#include <string>

struct Foo {
    operator std::string() const { return "hello"; }
};

int main()
{
    std::string a = Foo{};
    std::string b(Foo{});
    std::string c{Foo{}};
}

Strings a and b are able to be constructed, but c fails with an error about no
matching constructor. [dcl.init.list]/3.6 indicates that applicable
constructors should be considered - and there does exist a constructor that can
be called with Foo{}, so that line should compile as well.

-- 
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/20150526/3ee19c85/attachment.html>


More information about the llvm-bugs mailing list