• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
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 // UNSUPPORTED: c++98, c++03, c++11
11 // <optional>
12 
13 // struct in_place_t{};
14 // constexpr in_place_t in_place{};
15 
16 #include <experimental/optional>
17 #include <type_traits>
18 
19 using std::experimental::optional;
20 using std::experimental::in_place_t;
21 using std::experimental::in_place;
22 
23 constexpr
24 int
test(const in_place_t &)25 test(const in_place_t&)
26 {
27     return 3;
28 }
29 
main()30 int main()
31 {
32     static_assert((std::is_class<in_place_t>::value), "");
33     static_assert((std::is_empty<in_place_t>::value), "");
34 
35     static_assert(test(in_place) == 3, "");
36 }
37