[PATCH] D16552: Let clang not error out on `const std::vector<int> empty_vec; ` with libstdc++5.3.

Nico Weber via cfe-commits cfe-commits at lists.llvm.org
Tue Feb 16 14:04:49 PST 2016


thakis updated this revision to Diff 48107.
thakis added a comment.

Checkpointing; not production quality. I tried implementing the general DR 253 rule, and this patch mostly does that. It currently walks all fields and all bases for every const record decl; there should probably be a cache for "are all fields obviously initialized"; probably on CXXRecordDecl. I had to change some test cases, but nothing surprising.

However, while this patch does fix `const std::unordered_map<int, int> um;` with libstdc++5.3, it does _not_ fix `std::vector<int> v;` or `const std::unordered_map<int, int> um;` when -D_GLIBCXX_DEBUG=1 is passed in. Investigating that case more now.


http://reviews.llvm.org/D16552

Files:
  lib/Sema/SemaInit.cpp
  test/CXX/dcl.decl/dcl.fct.def/dcl.fct.def.default/p2.cpp
  test/CXX/dcl.decl/dcl.init/p6.cpp
  test/SemaCXX/attr-selectany.cpp
  test/SemaCXX/constexpr-value-init.cpp
  test/SemaCXX/cxx0x-cursory-default-delete.cpp
  test/SemaCXX/illegal-member-initialization.cpp

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D16552.48107.patch
Type: text/x-patch
Size: 9774 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20160216/d5d2b8b7/attachment.bin>


More information about the cfe-commits mailing list