[LLVMbugs] [Bug 16090] New: templated constexpr function with return type deduction does not compile
bugzilla-daemon at llvm.org
bugzilla-daemon at llvm.org
Tue May 21 06:19:34 PDT 2013
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: unassignedclangbugs at nondot.org
Reporter: jonathan.sauer at gmx.de
CC: dgregor at apple.com, llvmbugs at cs.uiuc.edu
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.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-bugs/attachments/20130521/9e0c27b1/attachment.html>
More information about the llvm-bugs
mailing list