Daily bump.
[official-gcc.git] / gcc / testsuite / g++.old-deja / g++.bugs / 900519_06.C
blob5704c3f9520929c3c51e0cab37863910c3a3fed2
1 // g++ 1.37.1 bug 900519_06
3 // g++ allows the type given in an invocation of operator new to be a
4 // reference type.
6 // Since pointers to reference types are illegal, the required return type
7 // from such an invocation (of operator new) is illegal, and thus (it seems)
8 // the entire call to new should be treated as being illegal.
10 typedef int& int_ref;
12 void test (int n)
14   new int&;             // ERROR - missed
15   new int_ref;          // ERROR - missed
16   new int&[n];          // ERROR - missed
17   new int_ref[n];       // ERROR - missed
18   new int&[3];          // ERROR - missed
19   new int_ref[3];       // ERROR - missed
22 int main () { return 0; }