diff options
Diffstat (limited to 'gcc/cp/init.c')
-rw-r--r-- | gcc/cp/init.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/gcc/cp/init.c b/gcc/cp/init.c index 6362263..1a5766a 100644 --- a/gcc/cp/init.c +++ b/gcc/cp/init.c @@ -1818,9 +1818,9 @@ expand_aggr_init_1 (tree binfo, tree true_exp, tree exp, tree init, int flags, } /* List-initialization from {} becomes value-initialization for non-aggregate - classes with default constructors. Handle this here so protected access - works. */ - if (init && TREE_CODE (init) == TREE_LIST) + classes with default constructors. Handle this here when we're + initializing a base, so protected access works. */ + if (exp != true_exp && init && TREE_CODE (init) == TREE_LIST) { tree elt = TREE_VALUE (init); if (DIRECT_LIST_INIT_P (elt) |