[llvm-bugs] [Bug 32144] New: [modules/c++14] constexpr function does not return a constexpr value

via llvm-bugs llvm-bugs at lists.llvm.org
Sun Mar 5 08:40:54 PST 2017


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: unassignedclangbugs at nondot.org
          Reporter: gonzalobg88 at gmail.com
                CC: dgregor at apple.com, llvm-bugs at 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.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-bugs/attachments/20170305/b8ce2a2b/attachment.html>


More information about the llvm-bugs mailing list