[Bug c++/12763] New: Error with tiny correct program (copy constructor with temporary problem?)
o dot kullmann at swansea dot ac dot uk
gcc-bugzilla@gcc.gnu.org
Fri Oct 24 16:19:00 GMT 2003
PLEASE REPLY TO gcc-bugzilla@gcc.gnu.org ONLY, *NOT* gcc-bugs@gcc.gnu.org.
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=12763
Summary: Error with tiny correct program (copy constructor with
temporary problem?)
Product: gcc
Version: 3.3.1
Status: UNCONFIRMED
Severity: normal
Priority: P2
Component: c++
AssignedTo: unassigned at gcc dot gnu dot org
ReportedBy: o dot kullmann at swansea dot ac dot uk
CC: gcc-bugs at gcc dot gnu dot org
struct X {
X(int) {}
};
int main() {
X(X(0));
X x(0);
}
> g++ Temporary.cpp
Temporary.cpp: In function `int main()':
Temporary.cpp:6: error: `X' undeclared (first use this function)
Temporary.cpp:6: error: (Each undeclared identifier is reported only
once for each function it appears in.)
Temporary.cpp:6: error: parse error before `(' token
Commenting out any of the two lines in main, and it compiles.
Error occurs also with version 3.2.1.
> g++ -v
Reading specs from
/home/kullmann/csoliver/GCC/gcc-3.3.1/lib/gcc-lib/i686-pc-linux-gnu/3.3.1/specs
Configured with: /home/kullmann/csoliver/GCC/gcc-3.3.1/configure
--enable-threads=posix --enable-long-long
--prefix=/home/kullmann/csoliver/GCC/gcc-3.3.1
--with-local-prefix=/home/kullmann/csoliver/GCC/Include_3.3.1/
--enable-languages=c,c++ --disable-nls --enable-shared
Thread model: posix
gcc version 3.3.1
More information about the Gcc-bugs
mailing list