no internal linkage in headers#687
Open
autoantwort wants to merge 1 commit into
Open
Conversation
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() {
| ^~~~~~~~~~~~~~~~~~~~~~~
There was a problem hiding this comment.
Code Review
This pull request removes the redundant static keyword from the constexpr function templates find_index and find_index_or_minus_one in include/rfl/internal/find_index.hpp. There are no review comments, and I have no feedback to provide.
Important
The consumer version of Gemini Code Assist on GitHub is being sunset. Starting June 18, 2026, new organization installations will be blocked, and all code review activity will officially cease on July 17, 2026.
For more details on the timeline and next steps, please review the Help Documentation.
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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.
Details