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

            Bug ID: 32144
           Summary: [modules/c++14] constexpr function does not return a
                    constexpr value
           Product: clang
           Version: trunk
          Hardware: PC
                OS: All
            Status: NEW
          Severity: enhancement
          Priority: P
         Component: Modules
          Assignee: unassignedclangb...@nondot.org
          Reporter: gonzalob...@gmail.com
                CC: dgre...@apple.com, llvm-bugs@lists.llvm.org

When enabling modules in the following situation

template <typename T>
static constexpr const auto var = std::numeric_limits<T>::max();

template <typename T, T val = var<T>>
using foo = std::integral_constant<T, val>;

foo<int> val;

I get an "error: non-type template argument is not a constant expression",
pointing that the "initializer of 'var<int>' is not a constant expression".

When disabling modules, everything compiles just fine.

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

Reply via email to