https://gcc.gnu.org/bugzilla/show_bug.cgi?id=127078
Bug ID: 127078
Summary: [modules] ICE: canonical types differ if forward
declaration is cv-qualified when type definition has
attributes
Product: gcc
Version: 17.0
Status: UNCONFIRMED
Severity: normal
Priority: P3
Component: c++
Assignee: unassigned at gcc dot gnu.org
Reporter: Lavrentii.Tsvetkov at viridiengroup dot com
Target Milestone: ---
Created attachment 65423
--> https://gcc.gnu.org/bugzilla/attachment.cgi?id=65423&action=edit
Patch for test suite
The error arises when combining definition modules with traditional
forward-declaration headers. In the simplified example, the qualified forward
declaration might come from a common include file, omitted in tests for
brevity.
// in header
typedef const class Q F;
// in module
typedef const class Q F;
class __attribute__((visibility("default"))) Q {};
Reproducible with latest master gcc version 17.0.0 20260819 (experimental)
(GCC).
Patch for testsuite to reproduce the ICE is attached.
g++ -std=c++20 -fmodules -fno-module-lazy ice-cvfwd-attr_a.H ice-cvfwd-attr_b.C