https://llvm.org/bugs/show_bug.cgi?id=31211

            Bug ID: 31211
           Summary: Access to static data member array initialized with
                    template parameter is not a constant expression
           Product: clang
           Version: trunk
          Hardware: PC
                OS: Linux
            Status: NEW
          Severity: normal
          Priority: P
         Component: C++14
          Assignee: [email protected]
          Reporter: [email protected]
                CC: [email protected]
    Classification: Unclassified

template <char C>
struct A {
    static constexpr char arr[] = {C};
    static constexpr auto c = *arr;
};

int main() {constexpr auto x = A<' '>::c;}

---

Fails, while it obviously shouldn't--the l-t-r conversion is fine as per
[expr.const]/(2.7.3), since we access a subobject of an object declared with
constexpr.

-- 
You are receiving this mail because:
You are on the CC list for the bug.
_______________________________________________
llvm-bugs mailing list
[email protected]
http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-bugs

Reply via email to