GCC Newspaper
OCTOBER 6, 2026
Date
/
Architectures
Components
Topics
News & Policy
Other
c++

Fix reflection source_location_of on member function reflections

Correctly retrieves source location for C++ member function reflections.

This commit fixes an issue in C++ reflection where the source_location_of function did not correctly retrieve the source location for member function reflections. By calling maybe_get_first_fn, the compiler can now access the DECL_SOURCE_LOCATION as intended, ensuring accurate reflection data.

In Details

The eval_source_location_of function in reflect.cc was missing a call to maybe_get_first_fn. This prevented it from resolving the correct DECL_SOURCE_LOCATION for member function reflections, leading to incorrect source location information being reported. The fix ensures this function is called, thus resolving the PR127493.

Filed Under: c++reflection