2 // { dg-do compile { target c++11 } }
4 namespace std { template <class T> T&& declval() noexcept; }
8 Base(const Base&) noexcept(false);
9 Base(Base&&) noexcept(false);
10 ~Base() noexcept(false);
16 // Derived(const Derived&) = default;
17 // Derived(Derived&&) = default;
20 static_assert(!noexcept(Base(std::declval<const Base&>())), "Error");
21 static_assert(!noexcept(Derived(std::declval<const Derived&>())), "Error"); // Error
23 static_assert(!noexcept(Base(std::declval<Base&&>())), "Error");
24 static_assert(!noexcept(Derived(std::declval<Derived&&>())), "Error"); // Error
26 static_assert(!noexcept(std::declval<Base&>().~Base()), "Error"); // OK
27 static_assert(!noexcept(std::declval<Derived&>().~Derived()), "Error"); // Error