<html>
    <head>
      <base href="http://llvm.org/bugs/" />
    </head>
    <body><table border="1" cellspacing="0" cellpadding="8">
        <tr>
          <th>Bug ID</th>
          <td><a class="bz_bug_link 
          bz_status_NEW "
   title="NEW --- - initialization list with conversion operator dont work properly and report error"
   href="http://llvm.org/bugs/show_bug.cgi?id=17376">17376</a>
          </td>
        </tr>

        <tr>
          <th>Summary</th>
          <td>initialization list with conversion operator dont work properly and report error
          </td>
        </tr>

        <tr>
          <th>Product</th>
          <td>clang
          </td>
        </tr>

        <tr>
          <th>Version</th>
          <td>trunk
          </td>
        </tr>

        <tr>
          <th>Hardware</th>
          <td>PC
          </td>
        </tr>

        <tr>
          <th>OS</th>
          <td>Linux
          </td>
        </tr>

        <tr>
          <th>Status</th>
          <td>NEW
          </td>
        </tr>

        <tr>
          <th>Severity</th>
          <td>normal
          </td>
        </tr>

        <tr>
          <th>Priority</th>
          <td>P
          </td>
        </tr>

        <tr>
          <th>Component</th>
          <td>C++11
          </td>
        </tr>

        <tr>
          <th>Assignee</th>
          <td>unassignedclangbugs@nondot.org
          </td>
        </tr>

        <tr>
          <th>Reporter</th>
          <td>mayur.p@samsung.com
          </td>
        </tr>

        <tr>
          <th>CC</th>
          <td>dgregor@apple.com, llvmbugs@cs.uiuc.edu, mayurthebond@gmail.com
          </td>
        </tr>

        <tr>
          <th>Classification</th>
          <td>Unclassified
          </td>
        </tr></table>
      <p>
        <div>
        <pre>for the following code:

struct X
{
  X();
};

struct Y
{
  operator X() const;
};

X a = { Y() };    // reports error: no matching constructor for initialization
of 'X'
X aa = Y();  // works fine


clang when compiled with std=c++11 gives compilation errors as:


testfile.C:11:3: error: no matching constructor for initialization of 'X'
X a = { Y() };    // reports error: no matching constructor for initialization
of 'X'
  ^   ~~~~~~~
testfile.C:1:8: note: candidate constructor (the implicit copy constructor) not
viable: no known conversion from 'Y' to 'const X &' for 1st
      argument
struct X
       ^
testfile.C:1:8: note: candidate constructor (the implicit move constructor) not
viable: no known conversion from 'Y' to 'X &&' for 1st
      argument
struct X
       ^
testfile.C:3:3: note: candidate constructor not viable: requires 0 arguments,
but 1 was provided
  X();
  ^
1 error generated.

It should have not thrown error as it works fine with gcc.</pre>
        </div>
      </p>
      <hr>
      <span>You are receiving this mail because:</span>
      
      <ul>
          <li>You are on the CC list for the bug.</li>
      </ul>
    </body>
</html>