-
Notifications
You must be signed in to change notification settings - Fork 161
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
21 changed files
with
192 additions
and
55 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
// Copyright (c) 2023 Bela Schaum, X-Ryl669, Denis Mikhailov. | ||
// | ||
// Distributed under the Boost Software License, Version 1.0. (See accompanying | ||
// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) | ||
|
||
|
||
// Initial implementation by Bela Schaum, https://github.com/schaumb | ||
// The way to make it union and UB free by X-Ryl669, https://github.com/X-Ryl669 | ||
// | ||
|
||
#ifndef BOOST_PFR_DETAIL_FAKE_OBJECT_HPP | ||
#define BOOST_PFR_DETAIL_FAKE_OBJECT_HPP | ||
#pragma once | ||
|
||
#include <boost/pfr/detail/config.hpp> | ||
|
||
namespace boost { namespace pfr { namespace detail { | ||
|
||
template <class T> | ||
extern const T fake_object; | ||
|
||
}}} // namespace boost::pfr::detail | ||
|
||
#endif // BOOST_PFR_DETAIL_FAKE_OBJECT_HPP | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
20 changes: 20 additions & 0 deletions
20
test/core_name/compile-fail/fields_names_disabled_via_macro_00.cpp
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
// Copyright (c) 2023 Bela Schaum, X-Ryl669, Denis Mikhailov. | ||
// | ||
// Distributed under the Boost Software License, Version 1.0. (See accompanying | ||
// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) | ||
|
||
|
||
// Initial implementation by Bela Schaum, https://github.com/schaumb | ||
// The way to make it union and UB free by X-Ryl669, https://github.com/X-Ryl669 | ||
// | ||
|
||
#define BOOST_PFR_CORE_NAME_ENABLED 0 | ||
#include <boost/pfr/core_name.hpp> | ||
|
||
struct A { int field; }; | ||
|
||
int main() { | ||
(void)boost::pfr::get_name<0, A>(); // Must be a compile time error | ||
} | ||
|
||
|
Oops, something went wrong.