[prev in list] [next in list] [prev in thread] [next in thread] 

List:       llvm-bugs
Subject:    [LLVMbugs] [Bug 15117] New: Unable to use std::initializer_list in constant expressions
From:       bugzilla-daemon () llvm ! org
Date:       2013-01-30 8:09:36
Message-ID: bug-15117-206 () http ! llvm ! org/bugs/
[Download RAW message or body]

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

             Bug #: 15117
           Summary: Unable to use std::initializer_list in constant
                    expressions
           Product: clang
           Version: trunk
          Platform: PC
        OS/Version: All
            Status: NEW
          Severity: enhancement
          Priority: P
         Component: C++11
        AssignedTo: unassignedclangbugs@nondot.org
        ReportedBy: dgregor@apple.com
                CC: dgregor@apple.com, llvmbugs@cs.uiuc.edu
    Classification: Unclassified


The following is well-formed:


#include <initializer_list>
constexpr auto foo{1, 2};


but Clang rejects it with


t2.cpp:3:16: error: constexpr variable 'foo' must be initialized by a constant
      expression
constexpr auto foo{1, 2};
               ^  ~~~~~~

because RecordExprEvaluator::VisitInitListExpr doesn't handle
std::initializer_lists. What it should do is create an array and then set the
pointer/length fields of the std::initializer_list to point into that array.

-- 
Configure bugmail: http://llvm.org/bugs/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are on the CC list for the bug.
_______________________________________________
LLVMbugs mailing list
LLVMbugs@cs.uiuc.edu
http://lists.cs.uiuc.edu/mailman/listinfo/llvmbugs
[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic