[PATCH] D35824: [Sema] Implicitly apply the may_alias attribute to std::byte

2017-07-25 Thread David Majnemer via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rL309058: [CodeGen] Correctly model std::byte's aliasing properties (authored by majnemer). Changed prior to commit: https://reviews.llvm.org/D35824?vs=108166&id=108185#toc Repository: rL LLVM https:/

[PATCH] D35824: [Sema] Implicitly apply the may_alias attribute to std::byte

2017-07-25 Thread Richard Smith - zygoloid via Phabricator via cfe-commits
rsmith accepted this revision. rsmith added a comment. This revision is now accepted and ready to land. LGTM with a tweaked comment. Thanks! Comment at: lib/CodeGen/CodeGenTBAA.cpp:88-90 + // C++1z [intro.object]p3: If a complete object is created in storage + // associated w

[PATCH] D35824: [Sema] Implicitly apply the may_alias attribute to std::byte

2017-07-25 Thread David Majnemer via Phabricator via cfe-commits
majnemer updated this revision to Diff 108166. majnemer added a comment. - Address review comments https://reviews.llvm.org/D35824 Files: include/clang/AST/Type.h lib/AST/Type.cpp lib/CodeGen/CodeGenTBAA.cpp test/CodeGenCXX/std-byte.cpp Index: test/CodeGenCXX/std-byte.cpp

[PATCH] D35824: [Sema] Implicitly apply the may_alias attribute to std::byte

2017-07-25 Thread Arthur O'Dwyer via Phabricator via cfe-commits
Quuxplusone added inline comments. Comment at: test/CodeGenCXX/std-byte.cpp:7 +enum byte : unsigned char {}; +} + Would it be worth adding an explicit test that `::byte`, `::my::byte`, `::my::std::byte` are or are not handled in the same way? https://reviews.l

[PATCH] D35824: [Sema] Implicitly apply the may_alias attribute to std::byte

2017-07-25 Thread David Majnemer via Phabricator via cfe-commits
majnemer updated this revision to Diff 108105. majnemer added a comment. - Address review feedback. https://reviews.llvm.org/D35824 Files: include/clang/AST/Type.h lib/AST/Type.cpp lib/CodeGen/CodeGenTBAA.cpp test/CodeGenCXX/std-byte.cpp Index: test/CodeGenCXX/std-byte.cpp ===

[PATCH] D35824: [Sema] Implicitly apply the may_alias attribute to std::byte

2017-07-24 Thread Richard Smith - zygoloid via Phabricator via cfe-commits
rsmith added a comment. I would prefer to handle `std::byte` explicitly in the places where it matters, rather than adding an attribute to it and otherwise treating it like any other enumeration. We're going to want to be able to identify `std::byte` for warning emission and probably other code

[PATCH] D35824: [Sema] Implicitly apply the may_alias attribute to std::byte

2017-07-24 Thread David Majnemer via Phabricator via cfe-commits
majnemer created this revision. std::byte, when defined as an enum, needs to be given special treatment with regards to its aliasing properties. An array of std::byte is allowed to be used as storage for other types. This fixes PR33916. https://reviews.llvm.org/D35824 Files: lib/Sema/SemaDec