// { dg-options "-Wnoexcept" }
template <class T>
-T f (T t) { return t; } // { dg-warning "does not throw" }
+T f (T t) { return t; } // { dg-message "does not throw" }
#define SA(X) static_assert(X, #X)
// We expect a warning at the declaration of construct2, since Automatic2 is
// defined below; we don't expect one for construct1, because Automatic1 is
// defined in the fake system header.
-// { dg-warning "noexcept-expression" "" { target *-*-* } 26 }
+// { dg-warning "noexcept-expression" "" { target *-*-* } 15 }
class Automatic2 {
public:
private:
size_t Bla;
- NotNoexcept Dummy;
};
union U
using size_t = decltype(sizeof(42));
inline void * operator new (size_t, void *p) noexcept { return p; }
-class NotNoexcept {
-public:
- NotNoexcept() noexcept(false) {}
- NotNoexcept(const NotNoexcept&) noexcept(false) {}
- NotNoexcept(NotNoexcept &&) noexcept(false) {}
- ~NotNoexcept() noexcept(false) {}
-
- NotNoexcept&operator=(const NotNoexcept&) noexcept(false) { return *this;}
- NotNoexcept&operator=(NotNoexcept &&) noexcept(false) {return *this;}
-};
-
template<typename _Up, typename... _Args>
void
construct1(_Up* __p, _Args... __args)
private:
size_t Bla;
- NotNoexcept Dummy;
};