1 //===----------------------------------------------------------------------===// 2 // 3 // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. 4 // See https://llvm.org/LICENSE.txt for license information. 5 // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception 6 // 7 //===----------------------------------------------------------------------===// 8 9 // <functional> 10 11 // reference_wrapper 12 13 // template <ObjectType T> reference_wrapper<T> ref(T& t); 14 15 // Don't allow binding to a temp 16 17 // XFAIL: c++03 18 19 #include <functional> 20 21 struct A {}; 22 23 const A source() {return A();} 24 25 int main(int, char**) 26 { 27 std::reference_wrapper<const A> r = std::ref(source()); 28 (void)r; 29 30 return 0; 31 } 32