public inbox for gcc@gcc.gnu.org
 help / color / mirror / Atom feed
From: Janis Johnson <janis187@us.ibm.com>
To: gcc@gcc.gnu.org
Subject: C++ ABI change since 3.2 with no warning
Date: Fri, 04 Oct 2002 17:02:00 -0000	[thread overview]
Message-ID: <20021004161706.A17403@us.ibm.com> (raw)

While working on C++ compatibility tests I broke up g++.dg/init/empty1.C
into this set of source files.  This test passes when everything is
built with either GCC 3.2 or with the mainline but fails when empty1_x.C
is compiled with GCC 3.2 and the rest is built with the mainline.  The
original test is for a PR that was fixed in 3.0.2.  The failure is due
to a change in alignment.  Is this expected?  Should it get a warning
with -Wabi for having changed since GCC 3.2?

Janis

--- empty1.h -----------------------------------------------------------
class EmptyBase0 {};

class EmptyBase1 : public EmptyBase0 {};

class Base1 {
public:
  unsigned int t_;
  Base1(unsigned int);
};

class PEPE : public Base1, public EmptyBase1 {
public:
  PEPE(unsigned int);
};
--- empty1_main.C ------------------------------------------------------
// Copyright (C) 2001 Free Software Foundation, Inc.
// Contributed by Nathan Sidwell 3 Sept 2001 <nathan@codesourcery.com>
// Split into pieces for binary compatibility testing October 2002

// Bug 4203. We were bit copying empty bases including the
// padding. Which clobbers whatever they overlay.

extern void empty1_x (void);

int
main ()
{
  empty1_x ();
}
--- empty1_x.C ---------------------------------------------------------
extern "C" void abort (void);

#include "empty1.h"

void
empty1_x ()
{
  PEPE pepe(0xff);
  
  if (pepe.t_ != 255)
    abort ();
}
--- empty1_y.C ---------------------------------------------------------
#include "empty1.h"

Base1::Base1(unsigned int t) : t_(t) {}
PEPE::PEPE(unsigned int t) : Base1(t), EmptyBase1(EmptyBase1()) {}
------------------------------------------------------------------------

             reply	other threads:[~2002-10-04 23:15 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2002-10-04 17:02 Janis Johnson [this message]
2002-10-08 13:09 ` Mark Mitchell

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20021004161706.A17403@us.ibm.com \
    --to=janis187@us.ibm.com \
    --cc=gcc@gcc.gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).