diff options
Diffstat (limited to 'gcc/cp/cp-lang.c')
| -rw-r--r-- | gcc/cp/cp-lang.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/gcc/cp/cp-lang.c b/gcc/cp/cp-lang.c index 94cf462..f1f5eed 100644 --- a/gcc/cp/cp-lang.c +++ b/gcc/cp/cp-lang.c @@ -347,7 +347,9 @@ cp_expr_size (tree exp) abort (); /* This would be wrong for a type with virtual bases, but they are caught by the abort above. */ - return CLASSTYPE_SIZE_UNIT (TREE_TYPE (exp)); + return (is_empty_class (TREE_TYPE (exp)) + ? size_zero_node + : CLASSTYPE_SIZE_UNIT (TREE_TYPE (exp))); } else /* Use the default code. */ |
