| 1 |
// PR c++/36871 |
| 2 |
// { dg-do run } |
| 3 |
// { dg-skip-if "requires hosted libstdc++ for cassert" { ! hostedlib } } |
| 4 |
#include <cassert> |
| 5 |
|
| 6 |
struct A { |
| 7 |
template <class T> A (T) |
| 8 |
#if __cplusplus <= 201402L |
| 9 |
throw(int) // { dg-warning "deprecated" "" { target { c++11 && { ! c++17 } } } } |
| 10 |
#endif |
| 11 |
; |
| 12 |
}; |
| 13 |
struct B { |
| 14 |
B (B&) throw (); |
| 15 |
template <class T> B (T) |
| 16 |
#if __cplusplus <= 201402L |
| 17 |
throw(int) // { dg-warning "deprecated" "" { target { c++11 && { ! c++17 } } } } |
| 18 |
#endif |
| 19 |
; |
| 20 |
}; |
| 21 |
|
| 22 |
int main () |
| 23 |
{ |
| 24 |
assert (__has_nothrow_copy (A)); |
| 25 |
assert (__has_nothrow_copy (B)); |
| 26 |
} |