rogfer01 updated this revision to Diff 82114.
rogfer01 added a comment.
Minor issues addressed
https://reviews.llvm.org/D23325
Files:
include/clang/AST/Decl.h
include/clang/AST/Expr.h
include/clang/AST/Stmt.h
include/clang/Basic/DiagnosticSemaKinds.td
include/clang/Basic/Specifiers.h
aaron.ballman added inline comments.
Comment at: include/clang/AST/Decl.h:2388
+ /// its alignment is smaller than the alignment of its field type.
+ bool isPackedField(const ASTContext& context) const;
+
Should be `&Context` instead of `& context`.
=
rogfer01 updated this revision to Diff 81955.
rogfer01 added a comment.
Rebase to current trunk
https://reviews.llvm.org/D23325
Files:
include/clang/AST/Decl.h
include/clang/AST/Expr.h
include/clang/AST/Stmt.h
include/clang/Basic/DiagnosticSemaKinds.td
include/clang/Basic/Specifiers.h
rogfer01 updated this revision to Diff 80081.
rogfer01 added a comment.
Drop attribute packed of a class when one of its fields is a non-packed non-pod
for compatibility with GCC.
https://reviews.llvm.org/D23325
Files:
include/clang/AST/Decl.h
include/clang/AST/Expr.h
include/clang/AST/S
rsmith added inline comments.
Comment at: include/clang/AST/Expr.h:440
+ ///
+ /// Likewise bitfields, we model gl-values referring to packed-fields as
+ /// an aspect of the value-kind type system.
aaron.ballman wrote:
> Like bitfields
> glvalues
"Likewise bi
rogfer01 updated this revision to Diff 78209.
rogfer01 added a comment.
Changes:
- Rebase patch to trunk
- Fixes as pointed out by reviewers
TODO:
- Diagnose and drop the packed attribute of a class with a nontrivially
constructed data member.
https://reviews.llvm.org/D23325
Files:
includ
rogfer01 marked 15 inline comments as done.
rogfer01 added a comment.
I am retaking this, will upload an updated patch soon.
Comment at: lib/AST/Decl.cpp:3523
+ return !isBitField() &&
+ (this->hasAttr() || getParent()->hasAttr()) &&
+ Context.getDeclAlign(this
rogfer01 added inline comments.
Comment at: include/clang/Basic/Specifiers.h:119-140
enum ExprObjectKind {
/// An ordinary object is located at an address in memory.
OK_Ordinary,
/// A bitfield object is a bitfield on a C or C++ record.
OK_BitField,
---
rsmith added inline comments.
Comment at: include/clang/AST/Expr.h:441
@@ +440,3 @@
+ /// Likewise bitfields, we model gl-values referring to packed-fields as
+ /// an aspect of the value-kind type system.
+ bool refersToPackedField() const { return getObjectKind() == OK_Packed
aaron.ballman added inline comments.
Comment at: include/clang/AST/Expr.h:436
@@ -434,1 +435,3 @@
+ /// \brief Returns true if this expression is a gl-value that
+ /// potentially refers to a packed-field. Here packed-field means
s/gl-value/glvalue
=
rogfer01 added inline comments.
Comment at: lib/Sema/SemaInit.cpp:4202-4204
@@ +4201,5 @@
+
+ It is not possible to bind w to a temporary of a.x because this
+ would require (recursively) invoking the copy constructor of
+ std::vector to obtain first a (properly
rogfer01 created this revision.
rogfer01 added reviewers: aaron.ballman, rsmith.
rogfer01 added subscribers: cfe-commits, rsmith.
This is a WIP for PR28571.
As suggested by @rsmith it introduces a new ObjectKind for PackedField's
modeled similarly in spirit to BitField's. If the reference is con
12 matches
Mail list logo