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: [email protected]
          Reporter: [email protected]
                CC: [email protected], [email protected]
    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.
_______________________________________________
LLVMbugs mailing list
[email protected]
http://lists.cs.uiuc.edu/mailman/listinfo/llvmbugs

Reply via email to