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: [email protected]
          Reporter: [email protected]
                CC: [email protected], [email protected]
    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.
_______________________________________________
LLVMbugs mailing list
[email protected]
http://lists.cs.uiuc.edu/mailman/listinfo/llvmbugs

Reply via email to