| 1 |
// { dg-do compile } |
| 2 |
// This code used to be accepted but it is invalid as there is no |
| 3 |
// value initialization of a reference type. |
| 4 |
// PR c++/36695 |
| 5 |
|
| 6 |
int main() |
| 7 |
{ |
| 8 |
typedef int& T; |
| 9 |
T a = T(); // { dg-error "value-initialization of reference" } |
| 10 |
} |
| 11 |
|