GCC Newspaper
NOVEMBER 30, 2026
Date
/
Architectures
Components
Topics
News & Policy
Other
codeview

Codeview handles enumerations without enumerators [PR126910].

Fixes a crash in CodeView generation for C++ enumerations that have no enumerators defined.

This commit resolves a crash in the CodeView debug info generator when processing C++ enumerations that contain no enumerator values. The function get_type_num_enumeration_type previously crashed due to an empty field list. A check is now added to handle this specific case gracefully, preventing the compiler from aborting and ensuring that such enumeration types are correctly represented in the debug output.

In Details

The get_type_num_enumeration_type function in dwarf2codeview.cc would crash when processing an enumeration type that declared no enumerators, resulting in an empty field list. This commit adds a check for this empty list condition, preventing the crash and allowing the compiler to correctly handle such enumeration types in the generated CodeView debug information.

For Context
CodeView
A proprietary debug information format developed by Microsoft, commonly used with the Visual C++ compiler and on Windows platforms. GCC supports generating CodeView debug info.
DW_AT_byte_size
An attribute within a DWARF DIE that specifies the size in bytes of the entity the DIE represents.
Filed Under: debugcodeviewcompiler bug