summaryrefslogtreecommitdiffstats
path: root/clang/lib/AST/Expr.cpp
diff options
context:
space:
mode:
authorRichard Smith <richard-llvm@metafoo.co.uk>2018-10-26 19:26:45 +0000
committerRichard Smith <richard-llvm@metafoo.co.uk>2018-10-26 19:26:45 +0000
commit6822bd79ac43f267613f1615bf60407103e24dba (patch)
tree3f29df66730f2992292de2bfd5e2913696043b6f /clang/lib/AST/Expr.cpp
parent9e22b4c76d7214002e446d28b5fa31102b529e99 (diff)
downloadbcm5719-llvm-6822bd79ac43f267613f1615bf60407103e24dba.tar.gz
bcm5719-llvm-6822bd79ac43f267613f1615bf60407103e24dba.zip
PR26547: alignof should return ABI alignment, not preferred alignment
Summary: - Add `UETT_PreferredAlignOf` to account for the difference between `__alignof` and `alignof` - `AlignOfType` now returns ABI alignment instead of preferred alignment iff clang-abi-compat > 7, and one uses _Alignof or alignof Patch by Nicole Mazzuca! Differential Revision: https://reviews.llvm.org/D53207 llvm-svn: 345419
Diffstat (limited to 'clang/lib/AST/Expr.cpp')
-rw-r--r--clang/lib/AST/Expr.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/clang/lib/AST/Expr.cpp b/clang/lib/AST/Expr.cpp
index e1e5c45efec..9df8aaad0b1 100644
--- a/clang/lib/AST/Expr.cpp
+++ b/clang/lib/AST/Expr.cpp
@@ -1446,7 +1446,7 @@ UnaryExprOrTypeTraitExpr::UnaryExprOrTypeTraitExpr(
// Check to see if we are in the situation where alignof(decl) should be
// dependent because decl's alignment is dependent.
- if (ExprKind == UETT_AlignOf) {
+ if (ExprKind == UETT_AlignOf || ExprKind == UETT_PreferredAlignOf) {
if (!isValueDependent() || !isInstantiationDependent()) {
E = E->IgnoreParens();
OpenPOWER on IntegriCloud