| 1 |
// { dg-do assemble } |
| 2 |
// g++ 1.37.1 bug 900519_06 |
| 3 |
|
| 4 |
// g++ allows the type given in an invocation of operator new to be a |
| 5 |
// reference type. |
| 6 |
|
| 7 |
// Since pointers to reference types are illegal, the required return type |
| 8 |
// from such an invocation (of operator new) is illegal, and thus (it seems) |
| 9 |
// the entire call to new should be treated as being illegal. |
| 10 |
|
| 11 |
typedef int& int_ref; |
| 12 |
|
| 13 |
void test (int n) |
| 14 |
{ |
| 15 |
new int&; // { dg-error "3:new cannot be applied to a reference type" } missed |
| 16 |
new int_ref; // { dg-error "3:new cannot be applied to a reference type" } missed |
| 17 |
new int&[n]; // { dg-error "" } missed |
| 18 |
new int_ref[n]; // { dg-error "3:new cannot be applied to a reference type" } missed |
| 19 |
new int&[3]; // { dg-error "" } missed |
| 20 |
new int_ref[3]; // { dg-error "3:new cannot be applied to a reference type" } missed |
| 21 |
} |
| 22 |
|
| 23 |
int main () { return 0; } |