Article View: gnu.g++.bug
Article #1427gcc bug
From: Glenn P Parker
Date: Tue, 26 Jan 1993 02:29
Date: Tue, 26 Jan 1993 02:29
39 lines
1719 bytes
1719 bytes
Submitted on behalf of Nickolay Yatsenko at Software Emancipation
Technology, Inc., Waltham, MA.
Reading specs from /usr/local/lib/gcc-lib/sparc-sun-sunos4.1/2.3.3/specs
gcc version 2.3.3
/usr/local/lib/gcc-lib/sparc-sun-sunos4.1/2.3.3/cpp -lang-c++ -v -undef -D__GNUC__=2 -D__GNUG__=2 -D__cplusplus -Dsparc -Dsun -Dunix -D__sparc__ -D__sun__ -D__unix__ -D__sparc -D__sun -D__unix fn_call2.C /usr/tmp/cca25955.i
GNU CPP version 2.3.3 (sparc)
/usr/local/lib/gcc-lib/sparc-sun-sunos4.1/2.3.3/cc1plus /usr/tmp/cca25955.i -quiet -dumpbase fn_call2.cc -version -o /usr/tmp/cca25955.s
GNU C++ version 2.3.3 (sparc) compiled by GNU C version 2.3.3.
fn_call2.C: In function `int main ()':
fn_call2.C:33: bad argument 0 for function `T::T (int)' (type was struct U)
// From ARM 5.2.2:
// Assignments to non-const reference parameter where the
// actual arg required a conversion.
struct T {
int a;
T(int aa) : a(aa) {}
};
struct U {
int a;
U(int aa) : a(aa) {}
operator T() { return T(a); }
};
void f_constT(const T & t)
{
int i = t.a + 1;
}
int main(void)
{
U u(0);
f_constT(u); // g++ cannot compile it, though cfront 2.1 and 3.0 can.
return 0;
}
Technical Details
Message-ID:
<199301260141.AA13906@world.std.com>Path:
arc1-ca.pugleaf.net!sparky!uunet!paladin.american.edu!howland.reston.ans.net!zaphod.mps.ohio-state.edu!pacific.mps.ohio-state.edu!cis.ohio-state.edu!world.std.com!gparkerShow Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!sparky!uunet!paladin.american.edu!howland.reston.ans.net!zaphod.mps.ohio-state.edu!pacific.mps.ohio-state.edu!cis.ohio-state.edu!world.std.com!gparker From: gparker@world.std.com (Glenn P Parker) Newsgroups: gnu.g++.bug Subject: gcc bug Date: 25 Jan 1993 21:29:34 -0500 Organization: GNUs Not Usenet Lines: 41 Sender: daemon@cis.ohio-state.edu Approved: bug-g++@prep.ai.mit.edu Distribution: gnu Message-ID: <199301260141.AA13906@world.std.com> Reply-To: <gparker@world.std.com> (Glenn Parker)