| 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, c++17, c++20 |
| 10 | |
| 11 | // These compilers don't support __builtin_is_implicit_lifetime yet. |
| 12 | // UNSUPPORTED: clang-18, clang-19, gcc-14, apple-clang-15, apple-clang-16, apple-clang-17 |
| 13 | |
| 14 | // <type_traits> |
| 15 | |
| 16 | // template<class T> struct is_implicit_lifetime; |
| 17 | |
| 18 | #include <type_traits> |
| 19 | |
| 20 | struct IncompleteStruct; |
| 21 | |
| 22 | // expected-error@*:* {{incomplete type 'IncompleteStruct' used in type trait expression}} |
| 23 | static_assert(!std::is_implicit_lifetime<IncompleteStruct>::value); |
| 24 | |
| 25 | // expected-error@*:* {{incomplete type 'IncompleteStruct' used in type trait expression}} |
| 26 | static_assert(!std::is_implicit_lifetime_v<IncompleteStruct>); |
| 27 | |