Mercurial > hg > CbC > CbC_gcc
view gcc/testsuite/g++.dg/eh/init-temp2.C @ 145:1830386684a0
gcc-9.2.0
author | anatofuz |
---|---|
date | Thu, 13 Feb 2020 11:34:05 +0900 |
parents | 04ced10e8804 |
children |
line wrap: on
line source
// PR c++/34196 // { dg-options "-O -Wuninitialized" } template <class _Tp> class AutoPtr { _Tp* _M_ptr; public: explicit AutoPtr(_Tp* __p = 0) : _M_ptr(__p) {} ~AutoPtr() #if __cplusplus <= 201402L throw(int) // { dg-warning "deprecated" "" { target { c++11 && { ! c++17 } } } } #else noexcept(false) #endif { delete _M_ptr; } }; struct A { A() { } ~A() #if __cplusplus <= 201402L throw(int) // { dg-warning "deprecated" "" { target { c++11 && { ! c++17 } } } } #else noexcept(false) #endif { throw 1; } }; struct B { virtual ~B() #if __cplusplus <= 201402L throw(int) // { dg-warning "deprecated" "" { target { c++11 && { ! c++17 } } } } #else noexcept(false) #endif ; }; B* f (const A &s) { throw 1; } int main() { AutoPtr<B> wt(f(A())); }