aboutsummaryrefslogtreecommitdiff
path: root/gcc/cp
diff options
context:
space:
mode:
authorJason Merrill <jason@redhat.com>2008-12-03 14:22:08 -0500
committerJason Merrill <jason@gcc.gnu.org>2008-12-03 14:22:08 -0500
commit27fb09b78e186d3d0173ee42cfc0af6801c2a9e2 (patch)
tree8cd5b380bdc43051a74bfd205672a42e6737f609 /gcc/cp
parent6efe1abf4c1fa501ed14b8d70a9c3f63df46102c (diff)
downloadgcc-27fb09b78e186d3d0173ee42cfc0af6801c2a9e2.zip
gcc-27fb09b78e186d3d0173ee42cfc0af6801c2a9e2.tar.gz
gcc-27fb09b78e186d3d0173ee42cfc0af6801c2a9e2.tar.bz2
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
Diffstat (limited to 'gcc/cp')
-rw-r--r--gcc/cp/ChangeLog8
-rw-r--r--gcc/cp/decl.c9
-rw-r--r--gcc/cp/pt.c1
3 files changed, 9 insertions, 9 deletions
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 <jason@redhat.com>
+
+ 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 <jason@redhat.com>
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);