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// WARNING: This test was generated by generate_feature_test_macro_components.py
10// and should not be edited manually.
11
12// <source_location>
13
14// Test the feature test macros defined by <source_location>
15
16// clang-format off
17
18#include <source_location>
19#include "test_macros.h"
20
21#if TEST_STD_VER < 14
22
23# ifdef __cpp_lib_source_location
24# error "__cpp_lib_source_location should not be defined before c++20"
25# endif
26
27#elif TEST_STD_VER == 14
28
29# ifdef __cpp_lib_source_location
30# error "__cpp_lib_source_location should not be defined before c++20"
31# endif
32
33#elif TEST_STD_VER == 17
34
35# ifdef __cpp_lib_source_location
36# error "__cpp_lib_source_location should not be defined before c++20"
37# endif
38
39#elif TEST_STD_VER == 20
40
41# ifndef __cpp_lib_source_location
42# error "__cpp_lib_source_location should be defined in c++20"
43# endif
44# if __cpp_lib_source_location != 201907L
45# error "__cpp_lib_source_location should have the value 201907L in c++20"
46# endif
47
48#elif TEST_STD_VER == 23
49
50# ifndef __cpp_lib_source_location
51# error "__cpp_lib_source_location should be defined in c++23"
52# endif
53# if __cpp_lib_source_location != 201907L
54# error "__cpp_lib_source_location should have the value 201907L in c++23"
55# endif
56
57#elif TEST_STD_VER > 23
58
59# ifndef __cpp_lib_source_location
60# error "__cpp_lib_source_location should be defined in c++26"
61# endif
62# if __cpp_lib_source_location != 201907L
63# error "__cpp_lib_source_location should have the value 201907L in c++26"
64# endif
65
66#endif // TEST_STD_VER > 23
67
68// clang-format on
69
70

source code of libcxx/test/std/language.support/support.limits/support.limits.general/source_location.version.compile.pass.cpp