| 1 |
// { dg-do compile } |
| 2 |
|
| 3 |
namespace __gnu_cxx __attribute__ ((__visibility__ ("default"))) { |
| 4 |
template<typename _Tp> class new_allocator { |
| 5 |
}; |
| 6 |
} |
| 7 |
namespace std { |
| 8 |
template<typename> class allocator; |
| 9 |
template<class _CharT> struct char_traits; |
| 10 |
template<typename _CharT, typename _Traits = char_traits<_CharT>, typename _Alloc = allocator<_CharT> > class basic_string; |
| 11 |
typedef basic_string<char> string; |
| 12 |
template<typename _Tp> class allocator: public __gnu_cxx::new_allocator<_Tp> { |
| 13 |
}; |
| 14 |
template<typename _CharT, typename _Traits, typename _Alloc> class basic_string { |
| 15 |
public: |
| 16 |
basic_string(const _CharT* __s, const _Alloc& __a = _Alloc()); |
| 17 |
}; |
| 18 |
} |
| 19 |
class UIException { |
| 20 |
}; |
| 21 |
class PasswordDialog { |
| 22 |
void run() |
| 23 |
#if __cplusplus <= 201402L |
| 24 |
throw (UIException) // { dg-warning "deprecated" "" { target { c++11 && { ! c++17 } } } } |
| 25 |
#endif |
| 26 |
; |
| 27 |
}; |
| 28 |
class MessageBox { |
| 29 |
public: |
| 30 |
MessageBox (std::string t) |
| 31 |
#if __cplusplus <= 201402L |
| 32 |
throw (UIException) // { dg-warning "deprecated" "" { target { c++11 && { ! c++17 } } } } |
| 33 |
#endif |
| 34 |
; |
| 35 |
virtual int run() |
| 36 |
#if __cplusplus <= 201402L |
| 37 |
throw (UIException) // { dg-warning "deprecated" "" { target { c++11 && { ! c++17 } } } } |
| 38 |
#endif |
| 39 |
; |
| 40 |
}; |
| 41 |
extern "C" { |
| 42 |
struct __jmp_buf_tag { |
| 43 |
}; |
| 44 |
extern int __sigsetjmp (struct __jmp_buf_tag __env[1], int __savemask) throw (); |
| 45 |
typedef struct __jmp_buf_tag sigjmp_buf[1]; |
| 46 |
} |
| 47 |
sigjmp_buf password_dialog_sig_jmp_buf; |
| 48 |
void PasswordDialog::run() |
| 49 |
#if __cplusplus <= 201402L |
| 50 |
throw (UIException) // { dg-warning "deprecated" "" { target { c++11 && { ! c++17 } } } } |
| 51 |
#endif |
| 52 |
{ |
| 53 |
__sigsetjmp (password_dialog_sig_jmp_buf, 1); |
| 54 |
MessageBox* errmsg = __null; |
| 55 |
errmsg = new MessageBox ("E R R O R"); |
| 56 |
errmsg->run(); |
| 57 |
} |