[PATCH] D23325: [WIP] Binding of references to packed fields

2016-12-20 Thread Roger Ferrer Ibanez via Phabricator via cfe-commits
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

[PATCH] D23325: [WIP] Binding of references to packed fields

2016-12-19 Thread Aaron Ballman via Phabricator via cfe-commits
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`. =

[PATCH] D23325: [WIP] Binding of references to packed fields

2016-12-19 Thread Roger Ferrer Ibanez via Phabricator via cfe-commits
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

[PATCH] D23325: [WIP] Binding of references to packed fields

2016-12-02 Thread Roger Ferrer Ibanez via Phabricator via cfe-commits
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

[PATCH] D23325: [WIP] Binding of references to packed fields

2016-11-16 Thread Richard Smith via cfe-commits
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

[PATCH] D23325: [WIP] Binding of references to packed fields

2016-11-16 Thread Roger Ferrer Ibanez via cfe-commits
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

[PATCH] D23325: [WIP] Binding of references to packed fields

2016-11-16 Thread Roger Ferrer Ibanez via cfe-commits
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

[PATCH] D23325: [WIP] Binding of references to packed fields

2016-11-16 Thread Roger Ferrer Ibanez via cfe-commits
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, ---

Re: [PATCH] D23325: [WIP] Binding of references to packed fields

2016-08-30 Thread Richard Smith via cfe-commits
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

Re: [PATCH] D23325: [WIP] Binding of references to packed fields

2016-08-30 Thread Aaron Ballman via cfe-commits
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 =

Re: [PATCH] D23325: [WIP] Binding of references to packed fields

2016-08-09 Thread Roger Ferrer Ibanez via cfe-commits
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

[PATCH] D23325: [WIP] Binding of references to packed fields

2016-08-09 Thread Roger Ferrer Ibanez via cfe-commits
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