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