xref: /aosp_15_r20/external/cronet/third_party/libc++/src/test/libcxx/utilities/optional/block.objc.pass.mm (revision 6777b5387eb2ff775bb5750e3f5d96f37fb7352b)
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// REQUIRES: has-fblocks
11// ADDITIONAL_COMPILE_FLAGS: -fblocks
12
13// <optional>
14
15// This test makes sure that we can create a `std::optional` containing
16// an Objective-C++ block.
17
18#include <optional>
19#include <cassert>
20
21int main(int, char**)
22{
23    using Block = void (^)(void);
24    std::optional<Block> block;
25    assert(!block);
26
27    return 0;
28}
29