Failure to parse nested explicit constructor calls in C++

Patrick Hartling patrick@137.org
Sun Sep 12 23:57:00 GMT 2004


I am running into a strange problem with GCC 3.2 and 3.3 where multiple
constructor calls in a single statement won't parse.  I have attached a
simple test case that can be used to repeat the problem.  With GCC 3.2
on Red Hat Linux 8.0 and FreeBSD 5.3-BETA3, I get the following error:

gcc-ctor-test.cpp: In function `int main()':
gcc-ctor-test.cpp:32: `string' specified as declarator-id
gcc-ctor-test.cpp:32: multiple declarations `int' and `Test'
gcc-ctor-test.cpp:32: invalid conversion from `const char*' to `int'

With GCC 3.3.2 on Fedora Core 1 and 3.3.3 on Fedora Core 2, I get the
following error:

gcc-ctor-test.cpp: In function `int main()':
gcc-ctor-test.cpp:32: error: variable declaration is not allowed here

With GCC 3.4.1 and the MIPSpro Compilers 7.3.1.3m, I have no problems
compiling the code.  I haven't tried versions of Visual C++ yet, but if
it would help, I can try VC++ 6 SP6, 7.0, and 7.1.

Is there a known GCC bug report that I could look at to get a better
understanding of what is happening?  Thus far, I haven't been able to
find one, but I am not entirely sure what to search for in Bugzilla.
Thanks.

 -Patrick


-- 
Patrick L. Hartling                     | Research Assistant, VRAC
http://www.137.org/patrick/             | 2274 Howe Hall Room 2624
PGP: http://tinyurl.com/2oum9           | http://www.vrac.iastate.edu/

-------------- next part --------------
A non-text attachment was scrubbed...
Name: gcc-ctor-test.cpp
Type: text/x-c++src
Size: 477 bytes
Desc: not available
URL: <https://gcc.gnu.org/pipermail/gcc/attachments/20040912/2d2accc4/attachment.bin>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 189 bytes
Desc: This is a digitally signed message part
URL: <https://gcc.gnu.org/pipermail/gcc/attachments/20040912/2d2accc4/attachment.sig>


More information about the Gcc mailing list