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:/
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
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
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
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
===
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
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