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 const, the binding is done using a temporary otherwise an error is diagnosed.
Paths
| Differential D23325
[WIP] Binding of references to packed fields Needs ReviewPublic Authored by rogfer01 on Aug 9 2016, 9:10 AM.
Details
Summary 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 const, the binding is done using a temporary otherwise an error is diagnosed.
Diff Detail Event Timeline
Comment Actions I am retaking this, will upload an updated patch soon.
Comment Actions Changes:
TODO:
Comment Actions Drop attribute packed of a class when one of its fields is a non-packed non-pod for compatibility with GCC.
Revision Contents
Diff 82114 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
include/clang/Sema/Initialization.h
lib/AST/ASTDumper.cpp
lib/AST/Decl.cpp
lib/Sema/SemaCast.cpp
lib/Sema/SemaDecl.cpp
lib/Sema/SemaExpr.cpp
lib/Sema/SemaExprMember.cpp
lib/Sema/SemaFixItUtils.cpp
lib/Sema/SemaInit.cpp
test/CodeGenCXX/pod-member-memcpys.cpp
test/SemaCXX/bind-packed-member.cpp
|
Should be &Context instead of & context.