summaryrefslogtreecommitdiffstats
path: root/clang/test/SemaCXX/address-packed.cpp
Commit message (Collapse)AuthorAgeFilesLines
* Ignore pointers to incomplete types when diagnosing misaligned addressesRoger Ferrer Ibanez2017-12-071-0/+9
| | | | | | | | | This is a fix for PR35509 in which we crash because we attempt to compute the alignment of an incomplete type. Differential Revision: https://reviews.llvm.org/D40895 llvm-svn: 320017
* Add missing testsRoger Ferrer Ibanez2016-08-171-0/+114
| | | | | | | | Change r278483 was missing the tests Differential Revision: https://reviews.llvm.org/D20561 llvm-svn: 278908
* Reverting 275417Roger Ferrer Ibanez2016-07-141-118/+0
| | | | | | This change has triggered unexpected failures. llvm-svn: 275462
* Diagnose taking address and reference binding of packed membersRoger Ferrer Ibanez2016-07-141-0/+118
| | | | | | | | | | | | | | | | | | | | | | | This patch implements PR#22821. Taking the address of a packed member is dangerous since the reduced alignment of the pointee is lost. This can lead to memory alignment faults in some architectures if the pointer value is dereferenced. This change adds a new warning to clang emitted when taking the address of a packed member. A packed member is either a field/data member declared as attribute((packed)) or belonging to a struct/class declared as such. The associated flag is -Waddress-of-packed-member. Conversions (either implicit or via a valid casting) to pointer types with lower or equal alignment requirements (e.g. void* or char*) silence the warning. This change also adds a new error diagnostic when the user attempts to bind a reference to a packed member, regardless of the alignment. Differential Revision: https://reviews.llvm.org/D20561 llvm-svn: 275417
* Reverting "Warn when taking address of a packed member"Roger Ferrer Ibanez2016-06-141-100/+0
| | | | | | | | This new diagnostic is causing some false positives that have to be addressed. This reverts commit 272552 llvm-svn: 272653
* Warn when taking address of a packed memberRoger Ferrer Ibanez2016-06-131-0/+100
This patch implements PR#22821. Taking the address of a packed member is dangerous since the reduced alignment of the pointee is lost. This can lead to memory alignment faults in some architectures if the pointer value is dereferenced. This change adds a new warning to clang emitted when taking the address of a packed member. A packed member is either a field/data member declared as attribute((packed)) or belonging to a struct/class declared as such. The associated flag is -Waddress-of-packed-member Differential Revision: http://reviews.llvm.org/D20561 llvm-svn: 272552
OpenPOWER on IntegriCloud