[Bug c++/123591] [16 Regression] ICE: Segmentation fault in tree_to_uhwi using offsetof with offsetof on a local type inside a lambda as a template argument

pinskia at gcc dot gnu.org gcc-bugzilla@gcc.gnu.org
Thu Jan 15 04:29:02 GMT 2026


https://gcc.gnu.org/bugzilla/show_bug.cgi?id=123591

Andrew Pinski <pinskia at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
         Depends on|                            |123550
           See Also|https://gcc.gnu.org/bugzill |
                   |a/show_bug.cgi?id=123536    |

--- Comment #1 from Andrew Pinski <pinskia at gcc dot gnu.org> ---
Slightly different testcase but the same issue:
```

#include <cstddef>
template <auto F = [] <auto G = [] {
    struct S {
        int out;
    };
    int offset = offsetof(S, out);
}> () {}>
void f() { F(); }

int main() { f(); }
```

But this is the same issue as PR 123550  really.


Referenced Bugs:

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=123550
[Bug 123550] [16 Regression] ICE in maybe_push_to_top_level, at
cp/name-lookup.cc:8983 since r16-6352


More information about the Gcc-bugs mailing list