[LLVMbugs] [Bug 18152] New: template parameter not treated as constexpr

bugzilla-daemon at llvm.org bugzilla-daemon at llvm.org
Thu Dec 5 13:28:54 PST 2013


            Bug ID: 18152
           Summary: template parameter not treated as constexpr
           Product: clang
           Version: trunk
          Hardware: PC
                OS: Linux
            Status: NEW
          Severity: normal
          Priority: P
         Component: C++11
          Assignee: unassignedclangbugs at nondot.org
          Reporter: sami.liedes at iki.fi
                CC: dgregor at apple.com, llvmbugs at cs.uiuc.edu
    Classification: Unclassified

GCC compiles this code with -std=c++11, but clang++ -std=c++11 fails with 

3:26: error: in-class initializer for static data member is not a constant

template<int B>
struct A {
    static const int len{B};

I haven't read the standard, but the claim that B is not a constexpr seems
rather surprising to me.

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/20131205/4ca4760f/attachment.html>

More information about the llvm-bugs mailing list