[llvm-bugs] [Bug 24903] New: clang fails to use constexpr variable template as default value of non-type template argument
via llvm-bugs
llvm-bugs at lists.llvm.org
Mon Sep 21 12:04:42 PDT 2015
https://llvm.org/bugs/show_bug.cgi?id=24903
Bug ID: 24903
Summary: clang fails to use constexpr variable template as
default value of non-type template argument
Product: clang
Version: 3.7
Hardware: PC
OS: Linux
Status: NEW
Severity: normal
Priority: P
Component: C++14
Assignee: unassignedclangbugs at nondot.org
Reporter: fmatthew5876 at gmail.com
CC: llvm-bugs at lists.llvm.org
Classification: Unclassified
template <typename T>
constexpr int A = 1;
template <typename T, int a = A<T>>
struct B {};
template struct B<int>;
The above code compiles in gcc but fails to compile in clang 3.7 with the
following error:
error : non-type template argument is not a constant expression
Theres also a stack overflow question with this same issue where someone claims
the bug was fixed when in fact it appears that it was not.
http://stackoverflow.com/questions/30260489/is-it-possible-to-use-a-constexpr-template-variable-as-the-default-for-a-forma/32702600#32702600
--
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/20150921/870b6e71/attachment.html>
More information about the llvm-bugs
mailing list