<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 - Explicit array initialization in an initializer list"
   href="https://bugs.llvm.org/show_bug.cgi?id=38043">38043</a>
          </td>
        </tr>

        <tr>
          <th>Summary</th>
          <td>Explicit array initialization in an initializer list
          </td>
        </tr>

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

        <tr>
          <th>Version</th>
          <td>unspecified
          </td>
        </tr>

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

        <tr>
          <th>OS</th>
          <td>Windows NT
          </td>
        </tr>

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

        <tr>
          <th>Severity</th>
          <td>enhancement
          </td>
        </tr>

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

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

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

        <tr>
          <th>Reporter</th>
          <td>zahira.ammarguellat@intel.com
          </td>
        </tr>

        <tr>
          <th>CC</th>
          <td>dgregor@apple.com, llvm-bugs@lists.llvm.org
          </td>
        </tr></table>
      <p>
        <div>
        <pre>Let's consider this test case:

#include <stdio.h>

struct foo {
  int i;
  foo() : i(23) {}
};

struct goo {
  goo() {}
  goo(const goo & other);
  foo _lala[2];
};

goo::goo(const goo & other)
  : _lala(other._lala)
{
}

int main()
{
  goo z;
  if (z._lala[0].i == 23)
    puts("passed");
  else
    puts("failed");
  return 0;
}

GCC compiles this.
CL and CLANG both generate an error.

Clang's error message is:
error: array initializer must be an initializer list


If the community doesn't want to follow GCC and allow array initialization via
an initializer list (violation of C++), then clang should at least return the
right error message as this is misleading?</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>