<html>
    <head>
      <base href="https://bugs.llvm.org/">
    </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 - Various problems with CTAD and disignated initialisers"
   href="https://bugs.llvm.org/show_bug.cgi?id=51401">51401</a>
          </td>
        </tr>

        <tr>
          <th>Summary</th>
          <td>Various problems with CTAD and disignated initialisers
          </td>
        </tr>

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

        <tr>
          <th>Version</th>
          <td>12.0
          </td>
        </tr>

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

        <tr>
          <th>OS</th>
          <td>All
          </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++2a
          </td>
        </tr>

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

        <tr>
          <th>Reporter</th>
          <td>h2+bugs@fsfe.org
          </td>
        </tr>

        <tr>
          <th>CC</th>
          <td>blitzrakete@gmail.com, erik.pilkington@gmail.com, llvm-bugs@lists.llvm.org, richard-llvm@metafoo.co.uk
          </td>
        </tr></table>
      <p>
        <div>
        <pre>All the code below builds with GCC>=10 and -std=c++20.
All except the two marked examples also build with MSVC.

Everything after "Outer2 o22" fails with Clang.

```c++
struct Inner
{
    int i = 0;
};

struct Outer1
{
    Inner s{};
};

template <typename T = int>
struct Outer2
{
    Inner s{};
};

template <typename T>
struct Outer3
{
    T s{};
};

int main()
{
    Outer1 o1{};
    Outer1 o2{{}};
    Outer1 o3{Inner{}};
    Outer1 o4{Inner{1}};
    Outer1 o5{.s = Inner{}};
    Outer1 o6{.s = Inner{ .i = 1}};

    Outer2 o21{};
    Outer2 o22{{}};
    Outer2 o23{Inner{}};                // fails in MSVC
    Outer2 o24{Inner{1}};               // fails in MSVC
    Outer2 o25{.s = Inner{}};
    Outer2 o26{.s = Inner{ .i = 1}};

    Outer3 o33{Inner{}};
    Outer3 o34{Inner{1}};
    Outer3 o35{.s = Inner{}};
    Outer3 o36{.s = Inner{ .i = 1}};
}
```</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>