Debian Codegraph @

libcxx/test/std/utilities/memory/unique.ptr/noexcept_operator_star.compile.pass.cpp

raw
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
10
11 // unique_ptr
12
13 // add_lvalue_reference_t<T> operator*() const noexcept(noexcept(*declval<pointer>()));
14
15 // Dereferencing pointer directly in noexcept fails for a void pointer. This
16 // is not SFINAE-ed away leading to a hard error. The issue was originally
17 // triggered by
18 // test/std/utilities/memory/unique.ptr/iterator_concept_conformance.compile.pass.cpp
19 //
20 // This test validates whether the code compiles.
21
22 #include <memory>
23
24 extern const std::unique_ptr<void> p;
25 void f() { [[maybe_unused]] bool b = noexcept(p.operator*()); }