This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c++/14397] [3.4/3.5 Regression] Trules no longer compile (regression)
- From: "bangerth at dealii dot org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 4 Mar 2004 14:05:22 -0000
- Subject: [Bug c++/14397] [3.4/3.5 Regression] Trules no longer compile (regression)
- References: <20040303052446.14397.schmid@snake.iap.physik.tu-darmstadt.de>
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
------- Additional Comments From bangerth at dealii dot org 2004-03-04 14:05 -------
Confirmed. Here is something even smaller:
-------------
struct S {
S (int);
S(S const&);
private:
S(S&);
};
S foo()
{
int result = 0;
return result;
}
----------------
And we get:
g/x> /home/bangerth/bin/gcc-3.5-pre/bin/c++ -c x.cc
x.cc: In function `S foo()':
x.cc:5: error: `S::S(S&)' is private
x.cc:11: error: within this context
x.cc:11: error: initializing temporary from result of `S::S(int)'
Note that apparently gcc calls the conversion constructor, and then wants
to call the copy constructor to get everything into the return slot (or
at least wants to make sure that the copy constructor is accessible). However,
it gets it wrong and looks for the constructor with the non-const argument,
rather than the one with the constant argument. If I remove the former,
gcc takes the latter (which is accessible) and is happy with it.
This is a regression on 3.4 and mainline w.r.t. 3.3.
W.
--
What |Removed |Added
----------------------------------------------------------------------------
Status|UNCONFIRMED |NEW
Ever Confirmed| |1
Known to fail| |3.4.0 3.5.0
Known to work| |3.3.4
Last reconfirmed|0000-00-00 00:00:00 |2004-03-04 14:05:21
date| |
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=14397