From bc6ea8125afbab8635f5c319229d1ba8aa2e25e2 Mon Sep 17 00:00:00 2001 From: Daniel Dunbar Date: Mon, 4 May 2009 20:52:37 +0000 Subject: [PATCH] Initialize NextOffset correctly, otherwise tight layout fails for empty classes. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@70905 91177308-0d34-0410-b5e6-96231b3b80d8 --- include/clang/AST/RecordLayout.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/include/clang/AST/RecordLayout.h b/include/clang/AST/RecordLayout.h index 57adc8a555..e764cf8a61 100644 --- a/include/clang/AST/RecordLayout.h +++ b/include/clang/AST/RecordLayout.h @@ -36,7 +36,7 @@ class ASTRecordLayout { friend class ASTContext; ASTRecordLayout(uint64_t S = 0, unsigned A = 8) - : Size(S), Alignment(A), FieldCount(0), NextOffset(0) {} + : Size(S), Alignment(A), FieldCount(0), NextOffset(S) {} ~ASTRecordLayout() { delete [] FieldOffsets; } -- 2.40.0