| 1 |
// { dg-do compile } |
| 2 |
|
| 3 |
// Copyright (C) 2003 Free Software Foundation, Inc. |
| 4 |
// Contributed by Nathan Sidwell 30 Jun 2003 <[email protected]> |
| 5 |
|
| 6 |
// PR c++ 9779. ICE |
| 7 |
|
| 8 |
struct I |
| 9 |
{ |
| 10 |
}; |
| 11 |
|
| 12 |
void Foo (int); |
| 13 |
namespace std |
| 14 |
{ |
| 15 |
template <typename X> |
| 16 |
void Baz (I *x) |
| 17 |
{ |
| 18 |
Foo (sizeof (I)); |
| 19 |
Foo (sizeof (x)); |
| 20 |
Foo (__alignof__ (I)); |
| 21 |
Foo (__alignof__ (x)); |
| 22 |
Foo (x->~I ()); // { dg-error "16:invalid" } |
| 23 |
// Foo (typeid (I)); |
| 24 |
Foo (delete x); // { dg-error "10:invalid" } |
| 25 |
Foo (delete[] x); // { dg-error "10:invalid" } |
| 26 |
Foo (throw x); // { dg-error "10:invalid" } |
| 27 |
} |
| 28 |
|
| 29 |
} |