[LLVMbugs] [Bug 18013] New: Regression, type mismatch in initializer_list causes clang Assertion failure

bugzilla-daemon at llvm.org bugzilla-daemon at llvm.org
Wed Nov 20 22:28:42 PST 2013


http://llvm.org/bugs/show_bug.cgi?id=18013

            Bug ID: 18013
           Summary: Regression, type mismatch in initializer_list causes
                    clang Assertion failure
           Product: clang
           Version: trunk
          Hardware: PC
                OS: All
            Status: NEW
          Severity: normal
          Priority: P
         Component: C++11
          Assignee: unassignedclangbugs at nondot.org
          Reporter: oneill+llvmbugs at cs.hmc.edu
                CC: dgregor at apple.com, llvmbugs at cs.uiuc.edu
    Classification: Unclassified

Created attachment 11578
  --> http://llvm.org/bugs/attachment.cgi?id=11578&action=edit
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.

-- 
You are receiving this mail because:
You are on the CC list for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-bugs/attachments/20131121/7bf91b65/attachment.html>


More information about the llvm-bugs mailing list