forked from OSchip/llvm-project
f55ce36c02
Summary: Per https://wg21.link/CWG1677, the C++11 standard did not clarify that constant initialization of an object allowed constexpr brace-or-equal initialization of subobjects: struct foo_t { union { int i; volatile int j; } u; }; __attribute__((__require_constant_initialization__)) static const foo_t x = {{0}}; Because foo_t::u has a volatile member, the initializer for x fails. However, there is really no good reason, because this: union foo_u { int i; volatile int j; }; __attribute__((__require_constant_initialization__)) static const foo_u x = {0}; does have a constant initializer. (This was triggered by musl's pthread_mutex_t type when building under C++11.) Reviewers: rsmith Subscribers: EricWF, cfe-commits Differential Revision: https://reviews.llvm.org/D28427 llvm-svn: 291480 |
||
---|---|---|
.. | ||
basic | ||
class | ||
class.access | ||
class.derived | ||
concepts-ts/dcl.dcl/dcl.spec/dcl.spec.concept | ||
conv | ||
cpp/cpp.predefined | ||
dcl.dcl | ||
dcl.decl | ||
drs | ||
except | ||
expr | ||
lex | ||
over | ||
special | ||
stmt.stmt | ||
temp |