aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJason Merrill <jason@yorick.cygnus.com>1998-05-03 02:30:57 +0000
committerJason Merrill <jason@gcc.gnu.org>1998-05-02 22:30:57 -0400
commit959d87966a28c5f67a33db114e4d342fe7072f0c (patch)
tree39c012108cbd87f4081860437911778013d6d707
parente40abc32364fa16fe666ca92248b008712221a2b (diff)
downloadgcc-959d87966a28c5f67a33db114e4d342fe7072f0c.zip
gcc-959d87966a28c5f67a33db114e4d342fe7072f0c.tar.gz
gcc-959d87966a28c5f67a33db114e4d342fe7072f0c.tar.bz2
call.c (build_over_call): Do evaluate arg even if it has empty class type.
* call.c (build_over_call): Do evaluate arg even if it has empty class type. * decl.c (start_function): Don't push a member function. From-SVN: r19525
-rw-r--r--gcc/cp/ChangeLog6
-rw-r--r--gcc/cp/call.c9
-rw-r--r--gcc/cp/decl.c5
3 files changed, 15 insertions, 5 deletions
diff --git a/gcc/cp/ChangeLog b/gcc/cp/ChangeLog
index 8596137..a1bf5c9 100644
--- a/gcc/cp/ChangeLog
+++ b/gcc/cp/ChangeLog
@@ -1,3 +1,9 @@
+Sun May 3 01:32:14 1998 Jason Merrill <jason@yorick.cygnus.com>
+
+ * call.c (build_over_call): Do evaluate arg even if it has empty
+ class type.
+ * decl.c (start_function): Don't push a member function.
+
Thu Apr 30 18:59:23 1998 Jim Wilson <wilson@cygnus.com>
* Makefile.in (g++FAQ.info): Put -o option before input file.
diff --git a/gcc/cp/call.c b/gcc/cp/call.c
index 5fd81f5..0c4326c 100644
--- a/gcc/cp/call.c
+++ b/gcc/cp/call.c
@@ -3363,7 +3363,8 @@ build_over_call (cand, args, flags)
/* Don't copy the padding byte; it might not have been allocated
if to is a base subobject. */
if (is_empty_class (DECL_CLASS_CONTEXT (fn)))
- return to;
+ return build (COMPOUND_EXPR, TREE_TYPE (to),
+ cp_convert (void_type_node, arg), to);
val = build (INIT_EXPR, DECL_CONTEXT (fn), to, arg);
TREE_SIDE_EFFECTS (val) = 1;
@@ -3377,12 +3378,14 @@ build_over_call (cand, args, flags)
tree to = stabilize_reference
(build_indirect_ref (TREE_VALUE (converted_args), 0));
+ arg = build_indirect_ref (TREE_VALUE (TREE_CHAIN (converted_args)), 0);
+
/* Don't copy the padding byte; it might not have been allocated
if to is a base subobject. */
if (is_empty_class (DECL_CLASS_CONTEXT (fn)))
- return to;
+ return build (COMPOUND_EXPR, TREE_TYPE (to),
+ cp_convert (void_type_node, arg), to);
- arg = build_indirect_ref (TREE_VALUE (TREE_CHAIN (converted_args)), 0);
val = build (MODIFY_EXPR, TREE_TYPE (to), to, arg);
TREE_SIDE_EFFECTS (val) = 1;
return val;
diff --git a/gcc/cp/decl.c b/gcc/cp/decl.c
index 56129f2..ede5d3c 100644
--- a/gcc/cp/decl.c
+++ b/gcc/cp/decl.c
@@ -11620,8 +11620,9 @@ start_function (declspecs, declarator, attrs, pre_parsed_p)
else if (pre_parsed_p == 0)
{
/* A specialization is not used to guide overload resolution. */
- if (flag_guiding_decls
- || !DECL_TEMPLATE_SPECIALIZATION (decl1))
+ if ((flag_guiding_decls
+ || !DECL_TEMPLATE_SPECIALIZATION (decl1))
+ && ! DECL_FUNCTION_MEMBER_P (decl1))
decl1 = pushdecl (decl1);
DECL_MAIN_VARIANT (decl1) = decl1;
fntype = TREE_TYPE (decl1);