1 //===----------------------------------------------------------------------===// 2 // 3 // The LLVM Compiler Infrastructure 4 // 5 // This file is dual licensed under the MIT and the University of Illinois Open 6 // Source Licenses. See LICENSE.TXT for details. 7 // 8 //===----------------------------------------------------------------------===// 9 10 // <functional> 11 12 // Check that libc++'s emulation of std::function is deprecated in C++03 13 14 // REQUIRES: c++03 15 16 #include <functional> 17 #include "test_macros.h" 18 19 int main(int, char**) { 20 // Note: 21 // We use sizeof() to require it to be a complete type. We don't create a 22 // variable because otherwise we get two warnings for each variable (the 23 // second warning is when the destructor is implicitly called). 24 (void)sizeof(std::function<void ()>); // expected-warning {{'function<void ()>' is deprecated}} 25 (void)sizeof(std::function<void (int)>); // expected-warning {{'function<void (int)>' is deprecated}} 26 (void)sizeof(std::function<void (int, int)>); // expected-warning {{'function<void (int, int)>' is deprecated}} 27 (void)sizeof(std::function<void (int, int, int)>); // expected-warning {{'function<void (int, int, int)>' is deprecated}} 28 return 0; 29 } 30