• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
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 // UNSUPPORTED: c++03, c++11, c++14
10 // <optional>
11 
12 // constexpr T& optional<T>::operator*() &;
13 
14 // UNSUPPORTED: libcxx-no-debug-mode
15 
16 // ADDITIONAL_COMPILE_FLAGS: -D_LIBCPP_DEBUG=1
17 #define _LIBCPP_ASSERT(x, m) ((x) ? (void)0 : std::exit(0))
18 
19 #include <optional>
20 #include <cassert>
21 
22 #include "test_macros.h"
23 
main(int,char **)24 int main(int, char**) {
25     std::optional<int> opt;
26     int x = *opt; (void)x;
27     assert(false);
28 
29     return 0;
30 }
31