summaryrefslogtreecommitdiffstats
path: root/gcc/cp/class.c
diff options
context:
space:
mode:
Diffstat (limited to 'gcc/cp/class.c')
-rw-r--r--gcc/cp/class.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/gcc/cp/class.c b/gcc/cp/class.c
index 6ed4cde6b51..bc17c82c6a0 100644
--- a/gcc/cp/class.c
+++ b/gcc/cp/class.c
@@ -3149,8 +3149,9 @@ check_field_decls (tree t, tree *access_decls,
CLASSTYPE_NON_AGGREGATE (t) = 1;
/* If at least one non-static data member is non-literal, the whole
- class becomes non-literal. */
- if (!literal_type_p (type))
+ class becomes non-literal. Note: if the type is incomplete we
+ will complain later on. */
+ if (COMPLETE_TYPE_P (type) && !literal_type_p (type))
CLASSTYPE_LITERAL_P (t) = false;
/* A standard-layout class is a class that:
OpenPOWER on IntegriCloud