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#include <boost/pfr/core_name.hpp>
12
13union test_union {
14 const char* c;
15 int i;
16};
17
18int main() {
19 (void)boost::pfr::get_name<0, test_union>(); // Must be a compile time error
20}
21
22
23

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