blob: 91b5d097f08697042617e8f651a7df6637b3f8dc (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
|
// { dg-do compile { target c++11 } }
// C++11 20.8.3.4 reference_wrapper invocation [refwrap.invoke]
#include <functional>
struct F
{
int operator()() noexcept(true) { return 1; }
int operator()() const noexcept(false) { return 2; }
};
F f;
static_assert( noexcept(std::ref(f)()) );
static_assert( ! noexcept(std::cref(f)()) );
|