1 //===----------------------------------------------------------------------===//
3 // The LLVM Compiler Infrastructure
5 // This file is dual licensed under the MIT and the University of Illinois Open
6 // Source Licenses. See LICENSE.TXT for details.
8 //===----------------------------------------------------------------------===//
10 // UNSUPPORTED: c++98, c++03, c++11
13 // T& optional<T>::value();
15 #include <experimental/optional>
16 #include <type_traits>
19 #include "test_macros.h"
21 using std::experimental::optional;
22 using std::experimental::bad_optional_access;
28 constexpr int test() const {return 3;}
29 int test() {return 4;}
37 assert(opt.value().test() == 4);
39 #ifndef TEST_HAS_NO_EXCEPTIONS
47 catch (const bad_optional_access&)