https://gcc.gnu.org/bugzilla/show_bug.cgi?id=114593
Bug ID: 114593
Summary: Failed type conversion on non-tagged derived type
inside a generic unit
Product: gcc
Version: 13.2.0
Status: UNCONFIRMED
Severity: normal
Priority: P3
Component: ada
Assignee: unassigned at gcc dot gnu.org
Reporter: jhb.chat at gmail dot com
CC: dkm at gcc dot gnu.org
Target Milestone: ---
Created attachment 57880
--> https://gcc.gnu.org/bugzilla/attachment.cgi?id=57880&action=edit
use gnatchop on file to get all example files separated
When converting from a System.Address type to a new type derived off of
System.Address inside a generic, the compiler fails with:
core-first-third.ads:6:04: error: instantiation error at
core-first-second.ads:15
core-first-third.ads:6:04: error: invalid conversion, not compatible with
private type "System.Address"
Doing the same in a basic example without generics involved compiles fine.
GCC version info:
gcc version 13.2.0 (Rev3, Built by MSYS2 project)
Platform is msys2 on Windows 10 home (up to date on all patches).
I also tested on godbolt and it fails starting with version 11.1 up to trunk as
of today. Last working version was 10.5
Example shows both a working type conversion in example.adb and a failed
compile example using generics. Simply commenting out the line 'with
Core.First.Third;` in example.adb will allow the program to compile as it
removes the generics.