Article View: gnu.g++.bug
Article #1306(none)
From: Werner Benger
Date: Mon, 04 Jan 1993 12:20
Date: Mon, 04 Jan 1993 12:20
45 lines
1564 bytes
1564 bytes
I am very sorry to tell you, that there are some errors remaining in
GCC 2.3.3.
GCC has problems, if the constructor of a nested class
is called to generate an object as parameter to another class. If
a temporary object is used, there are no troubles.
/****************************************************************************/
class A
{
class B
{
public: B(int i,float k);
};
public: A(int,B&);
};
A a(1,A::B(8,4.56)); // <---- no constructor named `B' in visible scope
// invalid functional cast
A::B tmp(8,4.56); // <---- This is ok !
A b(1,tmp);
/*****************************************************************************/
It is not possible to define a pointer to a class member as function
parameter.
/*****************************************************************************/
struct X
{
int a,b;
};
void x(int X::*i) // <--- parse error before `i'
{
int X::*j=i; // <--- `i` undeclared
}
main()
{
int X::*i=&X::a; // ( This line is ok for GCC )
x(&X::a);
}
/*****************************************************************************/
Best greetings from werner@ast1.uibk.ac.at
Technical Details
Message-ID:
<9301041020.AA15265@ast1.uibk.ac.at>Path:
arc1-ca.pugleaf.net!sparky!uunet!zaphod.mps.ohio-state.edu!cis.ohio-state.edu!ast1.uibk.ac.at!wernerShow Full Headers
Complete Article Headers
Newsgroups: gnu.g++.bug Path: arc1-ca.pugleaf.net!sparky!uunet!zaphod.mps.ohio-state.edu!cis.ohio-state.edu!ast1.uibk.ac.at!werner From: werner@ast1.uibk.ac.at ( Werner Benger ) Subject: (none) Message-ID: <9301041020.AA15265@ast1.uibk.ac.at> Sender: gnulists@ai.mit.edu Organization: GNUs Not Usenet Distribution: gnu Date: Mon, 4 Jan 1993 12:20:25 GMT Approved: bug-g++@prep.ai.mit.edu Lines: 47