<html>
    <head>
      <base href="https: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 --- - "return { value }" returns uninitialized std::initializer_list"
   href="https:llvm.org/bugs/show_bug.cgi?id=22861">22861</a>
          </td>
        </tr>

        <tr>
          <th>Summary</th>
          <td>"return { value }" returns uninitialized std::initializer_list
          </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>nlewycky@google.com
          </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>Testcase:

#include <initializer_list>
#include <cstdio>

std::initializer_list<int> MakeList() {
  return { 7 };
}

void helper(std::initializer_list<int> list) {
  for (auto i : list) {
    printf("%d\n", i);
  }
}

int main() {
  helper(MakeList());
}

This prints "32767" on my system, and has an msan error indicating that the
list allocated in MakeList was uninitialized memory, later read in the use of
'i' at the printf callsite.

GCC prints "7" which is what I'd expect. It's an x-value shouldn't go away
until the ';' at the end of helper(), right?</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>