-
Notifications
You must be signed in to change notification settings - Fork 154
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #140 from denzor200/get_name_fixes
Couple of fixes for get_name
- Loading branch information
Showing
4 changed files
with
46 additions
and
1 deletion.
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
17 changes: 17 additions & 0 deletions
17
test/core_name/compile-fail/fields_names_get_name_on_array.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,17 @@ | ||
// 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 | ||
// | ||
|
||
#include <boost/pfr/core_name.hpp> | ||
|
||
int main() { | ||
(void)boost::pfr::get_name<0, int[10]>(); // Must be a compile time error | ||
} | ||
|
||
|
17 changes: 17 additions & 0 deletions
17
test/core_name/compile-fail/fields_names_names_as_array_on_array.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,17 @@ | ||
// 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 | ||
// | ||
|
||
#include <boost/pfr/core_name.hpp> | ||
|
||
int main() { | ||
(void)boost::pfr::names_as_array<int[10]>(); // Must be a compile time error | ||
} | ||
|
||
|