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: unassignedclangb...@nondot.org
Reporter: chmiel...@int.pl
CC: llvm-bugs@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.
_______________________________________________
llvm-bugs mailing list
llvm-bugs@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-bugs