libstdc++-v3/testsuite/20_util/function/cons/70692.cc
raw| 1 | // { dg-do compile { target c++11 } } |
| 2 | // { dg-require-effective-target hosted } |
| 3 | // PR libstdc++/70692 |
| 4 | // No warning when function<const int&(...)> binds a reference to a temporary |
| 5 | #include <functional> |
| 6 | |
| 7 | int f(); |
| 8 | |
| 9 | int main() |
| 10 | { |
| 11 | std::function<const int&()> ff(f); // { dg-error "no matching function" } |
| 12 | std::function<long&&()> f2(f); // { dg-error "no matching function" } |
| 13 | } |
| 14 | // { dg-error "std::enable_if" "" { target *-*-* } 0 } |