Bug 34799 - [Ada] Assertion fails when no component clause is given for generic record member
Summary: [Ada] Assertion fails when no component clause is given for generic record me...
Status: RESOLVED FIXED
Alias: None
Product: gcc
Classification: Unclassified
Component: ada (show other bugs)
Version: 4.3.0
: P3 normal
Target Milestone: 4.4.0
Assignee: Samuel Tardieu
URL:
Keywords: ice-on-valid-code
Depends on:
Blocks:
 
Reported: 2008-01-15 15:29 UTC by Markus Heichel
Modified: 2008-02-27 11:57 UTC (History)
2 users (show)

See Also:
Host: i686-pc-linux
Target: i686-pc-linux
Build: i686-pc-linux
Known to work:
Known to fail:
Last reconfirmed: 2008-02-24 09:11:35


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Markus Heichel 2008-01-15 15:29:40 UTC
In the example below gcc reports an assertion failure, when warnings are switched on.

> gcc -c -gnatwa status.ads

fails, while

> gcc -c status.ads

is working.

The snapshot 4.3.0 20070921 is correctly warning 'no component clause given for "C" declared at line 12' while later snapshots (e.g. 4.3.0 20080111) fail.

status.ads
================================================
package STATUS is

   generic

      type CUSTOM_T is private;

   package HANDLER is

      type STORAGE_T is record
         A : Boolean;
         B : Boolean;
         C : CUSTOM_T;
      end record;

      for STORAGE_T use record
         A at 0 range 0..0;
         B at 1 range 0..0;
      end record;

   end HANDLER;

end STATUS;
================================================
Comment 1 Samuel Tardieu 2008-02-27 11:54:41 UTC
Subject: Bug 34799

Author: sam
Date: Wed Feb 27 11:53:55 2008
New Revision: 132707

URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=132707
Log:
    gcc/ada/
	PR ada/34799
	* sem_ch13.adb (Analyze_Record_Representation_Clause): Check
	that underlying type is present.

    gcc/testsuite/
	PR ada/34799
	* gnat.dg/specs/pr34799.ads: New test.


Added:
    trunk/gcc/testsuite/gnat.dg/specs/pr34799.ads
Modified:
    trunk/gcc/ada/ChangeLog
    trunk/gcc/ada/sem_ch13.adb
    trunk/gcc/testsuite/ChangeLog

Comment 2 Samuel Tardieu 2008-02-27 11:57:31 UTC
Fixed in SVN trunk