Commit 9469a8d
no internal linkage in headers
If I want to export an struct that has a rfl::Field, this template references the changed function and therefore tries to reference a TU-local entity which is illegal.
The stacktrace from gcc:
In file included from /root/.vs/src2/out/build/x64-debug-linux/vcpkg_installed/x64-linux/include/rfl/Literal.hpp:14,
from /root/.vs/src2/out/build/x64-debug-linux/vcpkg_installed/x64-linux/include/rfl/Field.hpp:8,
from /root/.vs/src2/out/build/x64-debug-linux/vcpkg_installed/x64-linux/include/rfl/AddStructName.hpp:6,
from /root/.vs/src2/out/build/x64-debug-linux/vcpkg_installed/x64-linux/include/rfl.hpp:10,
from /root/.vs/src2/*****/lib/pdaLib/TestVariable.ixx:3:
/root/.vs/src2/out/build/x64-debug-linux/vcpkg_installed/x64-linux/include/rfl/Tuple.hpp:229:7: error: 'using rfl::tuple_element_t = typename rfl::tuple_element<ix, typename std::remove_cvref<_Tp2>::type>::type' exposes TU-local entity 'struct rfl::tuple_element<ix, typename std::remove_cvref<_Tp2>::type>'
229 | using tuple_element_t =
| ^~~~~~~~~~~~~~~
/root/.vs/src2/out/build/x64-debug-linux/vcpkg_installed/x64-linux/include/rfl/Tuple.hpp:216:8: note: 'struct rfl::tuple_element<ix, typename std::remove_cvref<_Tp2>::type>' refers to TU-local object 'ix'
216 | struct tuple_element;
| ^~~~~~~~~~~~~
In file included from /root/.vs/src2/out/build/x64-debug-linux/vcpkg_installed/x64-linux/include/rfl/Literal.hpp:16:
/root/.vs/src2/out/build/x64-debug-linux/vcpkg_installed/x64-linux/include/rfl/internal/find_index.hpp:40:17: note: 'ix' has no linkage and is declared within TU-local entity 'constexpr int rfl::internal::find_index()'
40 | constexpr int ix = wrap_fields<_field_name, Fields>(
| ^~
/root/.vs/src2/out/build/x64-debug-linux/vcpkg_installed/x64-linux/include/rfl/internal/find_index.hpp:39:22: note: 'constexpr int rfl::internal::find_index()' declared with internal linkage
39 | constexpr static int find_index() {
| ^~~~~~~~~~
/root/.vs/src2/out/build/x64-debug-linux/vcpkg_installed/x64-linux/include/rfl/Tuple.hpp:229:7: error: 'using rfl::tuple_element_t = typename rfl::tuple_element<ix, typename std::remove_cvref<_Tp2>::type>::type' exposes TU-local entity 'struct rfl::tuple_element<ix, typename std::remove_cvref<_Tp2>::type>'
229 | using tuple_element_t =
| ^~~~~~~~~~~~~~~
/root/.vs/src2/out/build/x64-debug-linux/vcpkg_installed/x64-linux/include/rfl/Tuple.hpp:216:8: note: 'struct rfl::tuple_element<ix, typename std::remove_cvref<_Tp2>::type>' refers to TU-local object 'ix'
216 | struct tuple_element;
| ^~~~~~~~~~~~~
/root/.vs/src2/out/build/x64-debug-linux/vcpkg_installed/x64-linux/include/rfl/internal/find_index.hpp:53:19: note: 'ix' has no linkage and is declared within TU-local entity 'constexpr int rfl::internal::find_index_or_minus_one()'
53 | constexpr int ix = wrap_fields<_field_name, Fields>(
| ^~
/root/.vs/src2/out/build/x64-debug-linux/vcpkg_installed/x64-linux/include/rfl/internal/find_index.hpp:49:22: note: 'constexpr int rfl::internal::find_index_or_minus_one()' declared with internal linkage
49 | constexpr static int find_index_or_minus_one() {
| ^~~~~~~~~~~~~~~~~~~~~~~1 parent 594707d commit 9469a8d
1 file changed
Lines changed: 2 additions & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
36 | 36 | | |
37 | 37 | | |
38 | 38 | | |
39 | | - | |
| 39 | + | |
40 | 40 | | |
41 | 41 | | |
42 | 42 | | |
| |||
46 | 46 | | |
47 | 47 | | |
48 | 48 | | |
49 | | - | |
| 49 | + | |
50 | 50 | | |
51 | 51 | | |
52 | 52 | | |
| |||
0 commit comments