summaryrefslogtreecommitdiffstats
path: root/clang/test/CXX/basic/basic.start/basic.start.init
Commit message (Collapse)AuthorAgeFilesLines
* Allow constexpr construction of subobjects unconditionally, not just in C++14.David L. Jones2017-01-091-0/+21
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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
* Add a test file missed from r199782.Richard Smith2014-01-221-0/+24
llvm-svn: 199783
OpenPOWER on IntegriCloud