[Bug c++/32402] Error while allocating array of pointers to objects of a pure virtual class
p dot vestjens at gmail dot com
gcc-bugzilla@gcc.gnu.org
Tue Nov 13 13:38:00 GMT 2007
------- Comment #5 from p dot vestjens at gmail dot com 2007-11-13 13:38 -------
Okay. First of all the code causing the problems isn't actually my own code. It
is used in the Connexis middleware layer of IBM's Rational Rose Real-Time
application. The reproduce.cpp file was created by IBM's support department to
reproduce the problem. They claim that the file compiles with the GNU 3.2
compiler but not with the GNU 3.4.4 and 4.1.0 compilers. I'm using GNU 4.1.1
which also doesn't compile the code, but WindRiver's Tornado 2 GNU 2.7.2 and
the MS Visual Studio 6 compiler do.
The problem seems to lie in the abundant use of parentheses:
- "list = new (pure(*[3]));" => does not compile
- "list = new (pure*[3]);" => compiles
- "list = new pure(*[3]);" => does not compile
- "list = new pure*[3];" => compiles
So, the only question still relevant to me is whether the original construction
is valid C++ code according to the ISO C++ standard. I tried verifying this
using the grammar printed in Stroustrup's "C++ Programming language (third
edition" but did not quite succeed. I guess grammatically it is ok, but
semantically the GCC compiler interprets the construction differently from its
previous version(s).
How do we determine if the original construction is correct, both grammatically
and semantically? If it isn't valid, IBM should fix their code. If it is, there
might be a bug in GCC.
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=32402
More information about the Gcc-bugs
mailing list