[llvm-bugs] [Bug 26869] New: error: declaration of constexpr static data member 'var' requires an initializer
via llvm-bugs
llvm-bugs at lists.llvm.org
Mon Mar 7 14:00:17 PST 2016
https://llvm.org/bugs/show_bug.cgi?id=26869
Bug ID: 26869
Summary: error: declaration of constexpr static data member
'var' requires an initializer
Product: clang
Version: 3.8
Hardware: PC
OS: Linux
Status: NEW
Severity: normal
Priority: P
Component: C++11
Assignee: unassignedclangbugs at nondot.org
Reporter: jtony at ca.ibm.com
CC: dgregor at apple.com, llvm-bugs at lists.llvm.org
Classification: Unclassified
clang 3.6/3.8 both fail to compile the following test case while g++ can
compile it successfully.
-bash-4.2$ cat reduce.cpp
enum E1 { e1, e2 = 3, e3 };
template <class C> struct S { static constexpr E1 var = e1; };
template <> constexpr E1 S<int>::var;
-bash-4.2$
-bash-4.2$ clang++ -m64 reduce.cpp -std=c++11 -c
reduce.cpp:3:34: error: declaration of constexpr static data member 'var'
requires an initializer
template <> constexpr E1 S<int>::var;
^
1 error generated.
-bash-4.2$
-bash-4.2$ g++ -m64 reduce.cpp -std=c++11 -c
-bash-4.2$
--
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/20160307/705414f4/attachment.html>
More information about the llvm-bugs
mailing list