1 //===----------------------------------------------------------------------===//
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
7 //===----------------------------------------------------------------------===//
9 // UNSUPPORTED: c++03, c++11, c++14
14 // optional(T) -> optional<T>;
23 // Test the explicit deduction guides
25 // Test the implicit deduction guides
28 std::optional opt
; // expected-error {{no viable constructor or deduction guide for deduction of template arguments of 'optional'}}
32 // optional(nullopt_t)
33 std::optional
opt(std::nullopt
); // expected-error-re@optional:* {{static assertion failed{{.*}}instantiation of optional with nullopt_t is ill-formed}}