You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
libcxx/test/std/utilities/function.objects/refwrap/refwrap.helpers/ref_1.fail.cpp

30 lines
658 B
C++

//===----------------------------------------------------------------------===//
//
// The LLVM Compiler Infrastructure
//
// This file is dual licensed under the MIT and the University of Illinois Open
// Source Licenses. See LICENSE.TXT for details.
//
//===----------------------------------------------------------------------===//
// <functional>
// reference_wrapper
// template <ObjectType T> reference_wrapper<T> ref(T& t);
// Don't allow binding to a temp
// XFAIL: c++98, c++03
#include <functional>
struct A {};
const A source() {return A();}
int main()
{
std::reference_wrapper<const A> r = std::ref(source());
}