<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 --- - Regression, type mismatch in initializer_list causes clang Assertion failure"
   href="http://llvm.org/bugs/show_bug.cgi?id=18013">18013</a>
          </td>
        </tr>

        <tr>
          <th>Summary</th>
          <td>Regression, type mismatch in initializer_list causes clang Assertion failure
          </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>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++11
          </td>
        </tr>

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

        <tr>
          <th>Reporter</th>
          <td>oneill+llvmbugs@cs.hmc.edu
          </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>Created <span class=""><a href="attachment.cgi?id=11578" name="attach_11578" title="Preprocessed source">attachment 11578</a> <a href="attachment.cgi?id=11578&action=edit" title="Preprocessed source">[details]</a></span>
Preprocessed source

The following code:

#include <initializer_list>

int f()
{
    return 0;
}

std::initializer_list<long (*)()> var = {f};

in *earlier* versions of clang (e.g., 3.3 as shipped with Xcode) produces the
error

clang-bug.cpp:8:42: error: cannot initialize an array element of type
      'long (*)()' with an lvalue of type 'int ()': different return type
      ('long' vs 'int')
std::initializer_list<long (*)()> var = {f};

but in more recent versions (verified for 190291 and 195314), causes an assert
failure:

Assertion failed: (DeclType->isAggregateType() && "non-aggregate records should
be handed in CheckSubElementType"), function CheckListElementTypes, file
.../llvm/tools/clang/lib/Sema/SemaInit.cpp, line 780.</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>