http://llvm.org/bugs/show_bug.cgi?id=16090

            Bug ID: 16090
           Summary: templated constexpr function with return type
                    deduction does not compile
           Product: clang
           Version: trunk
          Hardware: All
                OS: All
            Status: NEW
          Severity: normal
          Priority: P
         Component: C++11
          Assignee: [email protected]
          Reporter: [email protected]
                CC: [email protected], [email protected]
    Classification: Unclassified

The following program does not compile with clang r181693:

constexpr auto foo() { return 0; }

template <typename T>
auto bar() { return 0; }

template <typename T>
constexpr auto baz() { return 0; }


This results in:

% clang++ -std=c++1y -v -c clang.cpp
clang version 3.4 (trunk 181693)
[...]
clang.cpp:7:16: error: constexpr function's return type 'auto' is not a literal
type
constexpr auto baz() { return 0; }
               ^
1 error generated.


- The non-templated constexpr variant "foo" compiles.
- The templated non-constexpr variant "bar" compiles, too.
- The templated constexpr variant "baz" does not compile, even though its body
is identical to the other two.

-- 
You are receiving this mail because:
You are on the CC list for the bug.
_______________________________________________
LLVMbugs mailing list
[email protected]
http://lists.cs.uiuc.edu/mailman/listinfo/llvmbugs

Reply via email to