https://gcc.gnu.org/bugzilla/show_bug.cgi?id=118219
Bug ID: 118219
Summary: Weird error: type of a component cannot be abstract.
Product: gcc
Version: 14.1.0
Status: UNCONFIRMED
Severity: normal
Priority: P3
Component: ada
Assignee: unassigned at gcc dot gnu.org
Reporter: p.p11 at orange dot fr
CC: dkm at gcc dot gnu.org
Target Milestone: ---
Created attachment 59987
--> https://gcc.gnu.org/bugzilla/attachment.cgi?id=59987&action=edit
Reproducer.
Given:
% cat test_20241227_abstract_ic.ads
package Test_20241227_abstract_IC is
type integral_constant1 is limited record
null;
end record;
type integral_constant2 is limited record
null;
end record with
Import => True, Convention => CPP;
end;
The following issue a weird error:
% gcc -c -gnatl test_20241227_abstract.adb
GNAT 14.1.0
Copyright 1992-2024, Free Software Foundation, Inc.
Compiling: test_20241227_abstract.adb
Source file time stamp: 2024-12-27 14:53:36
Compiled at: 2024-12-27 16:06:02
1. with Test_20241227_abstract_IC;
2. procedure Test_20241227_abstract is
3. type uu_is_fast_hash1 is limited record
4. parent : aliased Test_20241227_abstract_IC.integral_constant1;
5. end record;
6. type uu_is_fast_hash2 is limited record
7. parent : aliased Test_20241227_abstract_IC.integral_constant2;
|
>>> error: type of a component cannot be abstract
8. end record;
9. begin
10. null;
11. end Test_20241227_abstract;
11 lines: 1 error
The error is issued only with the type integral_constant2 which has aspects
Import => True, Convention => CPP.
Is it correct to issue an error in this case?
If so, the text of the error is confusing, isn't it?
Full source code archive in attachment.