This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

RFA - C++ new initializers


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

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]