This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
RFA - C++ new initializers
- To: gcc-bugs at gcc dot gnu dot org
- Subject: RFA - C++ new initializers
- From: Nathan Sidwell <nathan at codesourcery dot com>
- Date: Mon, 22 Jan 2001 10:22:38 +0000
- CC: mark at codesourcery dot com
- Organization: Codesourcery LLC
Hi,
this relates to bug 1654 which gives an ICE on `incorrect' use of
G++'s new initializer extension.
g++ allows one to say things like
new int = 5;
new int[4] = {1, 2, 3, 4};
However, that's giving an ICE in 1654's case, because it is saying
ContinuedFraction cf = {4, new BigInt = {2, 1, 4, 3}};
I can't see any documentation on this extension in extend.texi. I had
thought that maybe it was restricted to pod types, but testcase
g++.robertl/eb63.C indicates otherwise.
We also allow non-default initialization of array members like
new int[5] (3)
What to do.
a) remove the extensions.
b) deprecate the extensions.
c) keep them for non-pod types (and document them)
d) get them working for pod types too.
My preference is a or b.
comments?
nathan
--
Dr Nathan Sidwell :: http://www.codesourcery.com :: CodeSourcery LLC
'But that's a lie.' - 'Yes it is. What's your point?'
nathan@codesourcery.com : http://www.cs.bris.ac.uk/~nathan/ : nathan@acm.org