summaryrefslogtreecommitdiff
path: root/libstdc++-v3/testsuite/20_util/function/cons/70692.cc
blob: 7cdc472497e4b2f30326c4ba6e8dc0e2cd336a60 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
// { dg-do compile { target c++11 } }
// PR libstdc++/70692
// No warning when function<const int&(...)> binds a reference to a temporary
#include <functional>

int f();

int main()
{
  std::function<const int&()> ff(f);  // { dg-error "no matching function" }
  std::function<long&&()> f2(f);      // { dg-error "no matching function" }
}
// { dg-error "std::enable_if" "" { target *-*-* } 0 }