From 27fb09b78e186d3d0173ee42cfc0af6801c2a9e2 Mon Sep 17 00:00:00 2001 From: Jason Merrill Date: Wed, 3 Dec 2008 14:22:08 -0500 Subject: re PR c++/38380 (explicitly defaulted constructors vs. empty direct initialization) PR c++/38380 * decl.c (grokdeclarator): Only set DECL_NONCONVERTING_P on explicit constructors. * pt.c (tsubst_copy_and_build) [CONSTRUCTOR]: Propagate CONSTRUCTOR_IS_DIRECT_INIT. From-SVN: r142404 --- gcc/cp/ChangeLog | 8 ++++++++ gcc/cp/decl.c | 9 --------- gcc/cp/pt.c | 1 + 3 files changed, 9 insertions(+), 9 deletions(-) (limited to 'gcc/cp') diff --git a/gcc/cp/ChangeLog b/gcc/cp/ChangeLog index 124dc3f..4987ca4 100644 --- a/gcc/cp/ChangeLog +++ b/gcc/cp/ChangeLog @@ -1,3 +1,11 @@ +2008-12-03 Jason Merrill + + PR c++/38380 + * decl.c (grokdeclarator): Only set DECL_NONCONVERTING_P + on explicit constructors. + * pt.c (tsubst_copy_and_build) [CONSTRUCTOR]: Propagate + CONSTRUCTOR_IS_DIRECT_INIT. + 2008-12-02 Jason Merrill PR c++/35782, c++/37860 diff --git a/gcc/cp/decl.c b/gcc/cp/decl.c index d045935..8714432 100644 --- a/gcc/cp/decl.c +++ b/gcc/cp/decl.c @@ -9099,15 +9099,6 @@ grokdeclarator (const cp_declarator *declarator, is called a converting constructor. */ if (explicitp == 2) DECL_NONCONVERTING_P (decl) = 1; - else if (DECL_CONSTRUCTOR_P (decl)) - { - /* A constructor with no parms is not a conversion. - Ignore any compiler-added parms. */ - tree arg_types = FUNCTION_FIRST_USER_PARMTYPE (decl); - - if (arg_types == void_list_node) - DECL_NONCONVERTING_P (decl) = 1; - } } else if (TREE_CODE (type) == METHOD_TYPE) { diff --git a/gcc/cp/pt.c b/gcc/cp/pt.c index 8de27a6..db81942 100644 --- a/gcc/cp/pt.c +++ b/gcc/cp/pt.c @@ -11612,6 +11612,7 @@ tsubst_copy_and_build (tree t, } r = build_constructor (init_list_type_node, n); + CONSTRUCTOR_IS_DIRECT_INIT (r) = CONSTRUCTOR_IS_DIRECT_INIT (t); if (TREE_HAS_CONSTRUCTOR (t)) return finish_compound_literal (type, r); -- cgit v1.1