Debian Codegraph @

libstdc++-v3/testsuite/20_util/bind/dangling_ref.cc

raw
1 // { dg-do compile { target c++11 } }
2 // { dg-additional-options "-Wsystem-headers" }
3 #include <functional>
4
5 int f();
6 auto b = std::bind<const int&>(f);
7 int i = b(); // { dg-error "here" "" { target { c++14_down } } }
8 // { dg-error "dangling reference" "" { target { c++14_down } } 0 }
9 // { dg-error "reference to temporary" "" { target { c++14_down } } 0 }
10 // { dg-error "no matching function" "" { target c++17 } 0 }
11 // { dg-error "enable_if" "" { target c++17 } 0 }