1// g++ 1.37.1 bug 900519_09 2 3// g++ allows the allocation of const objects via operator new even when 4// these uses of operator new do not include initializations. 5 6// This is inconsistant within the restrictions placed on the construction 7// of class, struct, and union types which have constant members. 8 9// Since there is no completely valid way of initializing such objects 10// after the invocation of new, these cases should all be illegal. 11 12// keywords: operator new, initialization, const qualifier 13 14struct struct_0 { 15 int member; 16}; 17 18typedef const int const_int; 19typedef const struct struct_0 const_struct_0; 20 21void test () 22{ 23 new const int; // ERROR - 24 new const_int; // ERROR - 25 new const struct_0; // ERROR - 26 new const_struct_0; // ERROR - 27} 28 29int main () { return 0; } 30