1// Copyright (c) 2023 Bela Schaum, X-Ryl669, Denis Mikhailov.
2//
3// Distributed under the Boost Software License, Version 1.0. (See accompanying
4// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
5
6
7// Initial implementation by Bela Schaum, https://github.com/schaumb
8// The way to make it union and UB free by X-Ryl669, https://github.com/X-Ryl669
9//
10
11#define BOOST_PFR_FUNCTION_SIGNATURE " *[field] "
12#define BOOST_PFR_CORE_NAME_PARSING (3,2,"")
13#include <boost/pfr/core_name.hpp>
14
15#include <boost/core/lightweight_test.hpp>
16
17struct A { int field; };
18
19int main() {
20 BOOST_TEST_EQ( (boost::pfr::get_name<0,A>()), "field");
21
22 return boost::report_errors();
23}
24
25
26

source code of boost/libs/pfr/test/core_name/compile-fail/poor_fields_name.cpp