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

            Bug ID: 46499
           Summary: static constepxr members of arguments passed by
                    reference are not recognised as constexpr
           Product: clang
           Version: unspecified
          Hardware: PC
                OS: Windows NT
            Status: NEW
          Severity: enhancement
          Priority: P
         Component: C++17
          Assignee: [email protected]
          Reporter: [email protected]
                CC: [email protected], [email protected],
                    [email protected], [email protected]

clang does not appear to recognise that static constexpr members of arguments
passed by reference are constexpr.


template <int N>
struct A
{
        static constexpr int size = N;
};

void foo(A<4> v) // By-value is OK
{
        static_assert(v.size == 4);
}

void bar(A<4> & v) // By-ref is not
{
        static_assert(v.size == 4); // clang error
}


See https://godbolt.org/z/sM2qhZ

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

Reply via email to