aboutsummaryrefslogtreecommitdiff
path: root/gcc/cp/init.c
diff options
context:
space:
mode:
authorJason Merrill <jason@redhat.com>2011-02-10 11:29:49 -0500
committerJason Merrill <jason@gcc.gnu.org>2011-02-10 11:29:49 -0500
commit69f36ba6bd980b7a0a426beec9e6b2c495d129b4 (patch)
treec49864362c684ac4366e445c11ee2613ca837412 /gcc/cp/init.c
parent5b883ca61cf968fa32782309aa3750511b549889 (diff)
downloadgcc-69f36ba6bd980b7a0a426beec9e6b2c495d129b4.zip
gcc-69f36ba6bd980b7a0a426beec9e6b2c495d129b4.tar.gz
gcc-69f36ba6bd980b7a0a426beec9e6b2c495d129b4.tar.bz2
class.c (type_has_constexpr_default_constructor): Make sure the caller stripped an enclosing array.
* class.c (type_has_constexpr_default_constructor): Make sure the caller stripped an enclosing array. * init.c (perform_member_init): Strip arrays before calling it. From-SVN: r170006
Diffstat (limited to 'gcc/cp/init.c')
-rw-r--r--gcc/cp/init.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/gcc/cp/init.c b/gcc/cp/init.c
index 6ffdc2f..e590118 100644
--- a/gcc/cp/init.c
+++ b/gcc/cp/init.c
@@ -535,8 +535,10 @@ perform_member_init (tree member, tree init)
"uninitialized member %qD with %<const%> type %qT",
member, type);
+ core_type = strip_array_types (type);
+
if (DECL_DECLARED_CONSTEXPR_P (current_function_decl)
- && !type_has_constexpr_default_constructor (type))
+ && !type_has_constexpr_default_constructor (core_type))
{
if (!DECL_TEMPLATE_INSTANTIATION (current_function_decl))
error ("uninitialized member %qD in %<constexpr%> constructor",
@@ -544,7 +546,6 @@ perform_member_init (tree member, tree init)
DECL_DECLARED_CONSTEXPR_P (current_function_decl) = false;
}
- core_type = strip_array_types (type);
if (CLASS_TYPE_P (core_type)
&& (CLASSTYPE_READONLY_FIELDS_NEED_INIT (core_type)
|| CLASSTYPE_REF_FIELDS_NEED_INIT (core_type)))