aboutsummaryrefslogtreecommitdiff
path: root/lib/AST/ExprConstant.cpp
diff options
context:
space:
mode:
authorJohn McCall <rjmccall@apple.com>2013-05-06 07:40:34 +0000
committerJohn McCall <rjmccall@apple.com>2013-05-06 07:40:34 +0000
commit10f6f065456a2cfb6c2ab5dfedefb930e5e52e9d (patch)
tree6576c188ece19da725ee49abf51aa026366a80dd /lib/AST/ExprConstant.cpp
parent692eafd2052fb6ca581530d6f3569eea9520a508 (diff)
Require the containing type to be complete when we see
__alignof__ of a field. This problem can only happen in C++11. Also do some petty optimizations. rdar://13784901 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@181185 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/AST/ExprConstant.cpp')
-rw-r--r--lib/AST/ExprConstant.cpp4
1 files changed, 4 insertions, 0 deletions
diff --git a/lib/AST/ExprConstant.cpp b/lib/AST/ExprConstant.cpp
index 95bfd63f4d..2b9d13cec0 100644
--- a/lib/AST/ExprConstant.cpp
+++ b/lib/AST/ExprConstant.cpp
@@ -5915,6 +5915,10 @@ CharUnits IntExprEvaluator::GetAlignOfType(QualType T) {
CharUnits IntExprEvaluator::GetAlignOfExpr(const Expr *E) {
E = E->IgnoreParens();
+ // The kinds of expressions that we have special-case logic here for
+ // should be kept up to date with the special checks for those
+ // expressions in Sema.
+
// alignof decl is always accepted, even if it doesn't make sense: we default
// to 1 in those cases.
if (const DeclRefExpr *DRE = dyn_cast<DeclRefExpr>(E))