public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
From: "roman at binarylife dot net" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug c++/46626] [4.6 Regression] simple use of virtual methods causes pure virtual method call in c++0x mode
Date: Sat, 25 Dec 2010 01:49:00 -0000	[thread overview]
Message-ID: <bug-46626-4-2cfjLeQLWi@http.gcc.gnu.org/bugzilla/> (raw)
In-Reply-To: <bug-46626-4@http.gcc.gnu.org/bugzilla/>

http://gcc.gnu.org/bugzilla/show_bug.cgi?id=46626

--- Comment #8 from Roman Kononov <roman at binarylife dot net> 2010-12-25 01:49:05 UTC ---
With the patch applied to r168236:

$ cat test.cpp 
struct X {
    virtual int& x(int&)=0;
    virtual ~X() {}
};

struct Y {
    virtual int& y(int&)=0;
    virtual ~Y() {}
};

struct Z: X, Y {
    int& x(int&);
    int& y(int&);
};

void func() {
    Z z;
}

$ g++ -c -std=c++0x test.cpp
test.cpp: In function 'void func()':
test.cpp:17:7:   in constexpr expansion of 'z.Z::Z()'
test.cpp:17:7: internal compiler error: in cxx_eval_bare_aggregate, at
cp/semantics.c:6352
Please submit a full bug report,
with preprocessed source if appropriate.
See <http://gcc.gnu.org/bugs.html> for instructions.

Without the patch, with the same test.cpp:

$ g++ -c -std=c++0x test.cpp; echo $?
0

Without the patch, with slightly different test1.cpp:

0 rk@wata:~/tmp/qqq>cat test1.cpp 
struct X {
    virtual int& x(int&)=0;
//  virtual ~X() {}
};

struct Y {
    virtual int& y(int&)=0;
//  virtual ~Y() {}
};

struct Z: X, Y {
    int& x(int&);
    int& y(int&);
};

void func() {
    Z z;
}

0 rk@wata:~/tmp/qqq>g++ -c -std=c++0x test1.cpp
test1.cpp: In function 'void func()':
test1.cpp:17:7:   in constexpr expansion of 'z.Z::Z()'
test1.cpp:17:7: internal compiler error: in cxx_eval_bare_aggregate, at
cp/semantics.c:6338
Please submit a full bug report,
with preprocessed source if appropriate.
See <http://gcc.gnu.org/bugs.html> for instructions.


  parent reply	other threads:[~2010-12-25  1:49 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-11-23 19:10 [Bug c++/46626] New: " zsojka at seznam dot cz
2010-11-23 20:01 ` [Bug c++/46626] " redi at gcc dot gnu.org
2010-11-23 20:07 ` hjl.tools at gmail dot com
2010-11-23 20:21 ` hjl.tools at gmail dot com
2010-11-24 12:04 ` rguenth at gcc dot gnu.org
2010-12-08  0:43 ` zsojka at seznam dot cz
2010-12-08  2:07 ` redi at gcc dot gnu.org
2010-12-08 12:40 ` zsojka at seznam dot cz
2010-12-23 12:35 ` jakub at gcc dot gnu.org
2010-12-25  1:49 ` roman at binarylife dot net [this message]
2010-12-27 12:54 ` jakub at gcc dot gnu.org
2010-12-27 13:15 ` jakub at gcc dot gnu.org

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=bug-46626-4-2cfjLeQLWi@http.gcc.gnu.org/bugzilla/ \
    --to=gcc-bugzilla@gcc.gnu.org \
    --cc=gcc-bugs@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).