Landing: 5f9f8711bf79

Project / Subsystem

gcc / c++

Date

2026-09-30

Author

Marek Polacek

Commit

5f9f8711bf791130fd30bc1f04b2097f3ef25f0b

Source

github

Perf win

No

Breaking

No

All attributes

project
gcc
subsystem
c++
patch_id
—
commit_hash
5f9f8711bf791130fd30bc1f04b2097f3ef25f0b
source_type
github
headline
c++: Fix ICE with -Wsubobject-linkage and function types.
tldr
Fixes an Internal Compiler Error (ICE) when using the -Wsubobject-linkage warning with function types.
author
Marek Polacek
outcome
committed
performance_win
false
breaking_change
false
series_id
—
series_parts
[]
tags
  • • c++
  • • compiler
  • • bugfix
  • • warning
discussion_id_link
—
bugzilla_pr
—
date
2026-09-30T00:00:00.000Z

This commit addresses an Internal Compiler Error (ICE) that occurred when the -Wsubobject-linkage warning was enabled for code involving function types or pointers to data members. The compiler crashed when attempting to access TYPE_MAIN_DECL of a function type, which lacks such a declaration. The fix adds a check for OVERLOAD_TYPE_P before calling decl_anon_ns_mem_p, preventing the invalid access.