[llvm-bugs] [Bug 35311] New: Constexpr constructor of templated class does not require member initialization.
via llvm-bugs
llvm-bugs at lists.llvm.org
Tue Nov 14 14:26:05 PST 2017
https://bugs.llvm.org/show_bug.cgi?id=35311
Bug ID: 35311
Summary: Constexpr constructor of templated class does not
require member initialization.
Product: clang
Version: unspecified
Hardware: PC
OS: All
Status: NEW
Severity: enhancement
Priority: P
Component: -New Bugs
Assignee: unassignedclangbugs at nondot.org
Reporter: chmielarz at int.pl
CC: llvm-bugs at lists.llvm.org
The standard requires that "for the constructor of a class or struct, every
base class sub-object and every non-variant non-static data member must be
initialized."[cpprefence.com]
Clang seems to ignore that requirement if the struct is a template.
This behavior is the same regardless of the version and standard.
Minimal example:
template<typename T> // commenting out this line generates appropriate errors
struct S{
constexpr S() /*: i(1)*/ {}
int i;
};
constexpr S<int> s;
int main() { return s.i; }
--
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/20171114/b1c27fe1/attachment.html>
More information about the llvm-bugs
mailing list