Fix double-free error with sizeof applied to VLA types.
- PR2727.
Also, fix warning in CodeGenTypes for new BlockPointer type.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@55479 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/lib/AST/Expr.cpp b/lib/AST/Expr.cpp
index a7e49d0..49c76a8 100644
--- a/lib/AST/Expr.cpp
+++ b/lib/AST/Expr.cpp
@@ -1236,6 +1236,11 @@
return ::evaluateOffsetOf(C, cast<Expr>(Val)) / CharSize;
}
+void SizeOfAlignOfTypeExpr::Destroy(ASTContext& C) {
+ // Override default behavior of traversing children. We do not want
+ // to delete the type.
+}
+
//===----------------------------------------------------------------------===//
// Child Iterators for iterating over subexpressions/substatements
//===----------------------------------------------------------------------===//