| 1 |
// PR c++/100635 |
| 2 |
// { dg-do compile } |
| 3 |
// { dg-additional-options "-Wno-volatile" { target c++2a } } |
| 4 |
|
| 5 |
struct S { }; |
| 6 |
volatile S v(); |
| 7 |
const volatile S& svol = v(); // { dg-error "cannot bind lvalue reference of type 'const volatile S&' to an rvalue of type 'volatile S'" } |
| 8 |
|
| 9 |
#if __cplusplus >= 201103L |
| 10 |
volatile int&& declvol(); |
| 11 |
const volatile int& voli = declvol(); // { dg-error "cannot bind lvalue reference of type 'const volatile int&' to an rvalue of type 'volatile int'" "" { target c++11} } |
| 12 |
#endif |