<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 --- - Poor diagnostic when a default argument uses a default initializer that has not been parsed yet"
   href="http://llvm.org/bugs/show_bug.cgi?id=16550">16550</a>
          </td>
        </tr>

        <tr>
          <th>Summary</th>
          <td>Poor diagnostic when a default argument uses a default initializer that has not been parsed yet
          </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>richard-llvm@metafoo.co.uk
          </td>
        </tr>

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

        <tr>
          <th>Classification</th>
          <td>Unclassified
          </td>
        </tr></table>
      <p>
        <div>
        <pre>struct A
{
    struct B
    {
        int i = 0;
    };

    B b;

    A(const B& _b = B())
        : b(_b)
    {}
};

test.cpp:11:21: error: defaulted default constructor of 'B' cannot be used by
non-static data member initializer which appears before end of class definition
    A(const B& _b = B())
                    ^

This diagnostic is not correct. We should really say something more like:

test.cpp:5:17: error: non-static data member initializer used within class
definition
        int i = 0;
                ^
test.cpp:11:21: note: implicitly used by use of defaulted default constructor
for 'B' in default argument here
    A(const B& _b = B())
                    ^

(We should probably wait until we have wording for core issue 1607 before
proceeding here; it's not entirely clear exactly what the rules will be yet.)</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>