[Bug ada/29015] Ada 2005 observer pattern with mutually dependent packages and containers produces compiler error

2008-04-16 Thread sam at gcc dot gnu dot org


--- Comment #9 from sam at gcc dot gnu dot org  2008-04-16 12:38 ---
Subject: Bug 29015

Author: sam
Date: Wed Apr 16 12:37:38 2008
New Revision: 134345

URL: http://gcc.gnu.org/viewcvs?root=gccview=revrev=134345
Log:
gcc/ada/
PR ada/29015
* sem_ch12.adb (Instantiate_Type): Check whether the full view of
the type is known instead of the underlying type.

gcc/testsuite/
PR ada/29015
* gnat.dg/incomplete1.ads, gnat.dg/incomplete2.ads,
gnat.dg/incomplete2.adb: New.

Added:
trunk/gcc/testsuite/gnat.dg/incomplete1.ads
trunk/gcc/testsuite/gnat.dg/incomplete2.adb
trunk/gcc/testsuite/gnat.dg/incomplete2.ads
Modified:
trunk/gcc/ada/ChangeLog
trunk/gcc/ada/sem_ch12.adb
trunk/gcc/testsuite/ChangeLog


-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=29015



[Bug ada/29015] Ada 2005 observer pattern with mutually dependent packages and containers produces compiler error

2008-04-16 Thread sam at gcc dot gnu dot org


--- Comment #10 from sam at gcc dot gnu dot org  2008-04-16 12:44 ---
This is fixed in the current GCC SVN.


-- 

sam at gcc dot gnu dot org changed:

   What|Removed |Added

 Status|ASSIGNED|RESOLVED
 Resolution||FIXED
   Target Milestone|--- |4.4.0


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=29015



[Bug ada/29015] Ada 2005 observer pattern with mutually dependent packages and containers produces compiler error

2008-04-09 Thread laguest at archangeli dot demon dot co dot uk


--- Comment #5 from laguest at archangeli dot demon dot co dot uk  
2008-04-09 19:45 ---
This is still a problem on 4.4.0 trunk.

Luke.


-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=29015



[Bug ada/29015] Ada 2005 observer pattern with mutually dependent packages and containers produces compiler error

2008-04-09 Thread ludovic at ludovic-brenta dot org


--- Comment #6 from ludovic at ludovic-brenta dot org  2008-04-09 20:10 
---
Reduced test case:

package Observers is
  type Observer is tagged null record;
  type Observer_Access is access all Observers.Observer'Class;
end Observers;

limited with Observers;
with Ada.Containers.Doubly_Linked_Lists;
package Subjects is
  function Equals(Left, Right : access Observers.Observer) return Boolean;
  package Observer_Lists is new
Ada.Containers.Doubly_Linked_Lists(Observers.Observer_Access, Equals);
end Subjects;

with Observers; -- this line triggers the bug
package body Subjects is
   function Equals(Left, Right : access Observers.Observer) return Boolean is
   begin
  return False;
   end Equals;
end Subjects;

With the line that triggers the bug:

gcc-4.1 -c -gnat05 subjects.adb
+===GNAT BUG DETECTED==+
| 4.1.3 20070518 (prerelease) (Debian 4.1.2-8) (x86_64-pc-linux-gnu)   |
| Assert_Failure atree.adb:812 |
| Error detected at subjects.ads:8:3   |

gcc-4.3 -c -gnat05 subjects.adb
+===GNAT BUG DETECTED==+
| 4.3.1 20080401 (prerelease) (x86_64-pc-linux-gnu) Assert_Failure
atree.adb:886|
| Error detected at subjects.ads:8:3   |


Without the line that triggers the bug:

gcc-4.1 -c -gnat05 subjects.adb
subjects.ads:9:49: premature use of incomplete type
subjects.ads:9:49: instantiation abandoned

gcc-4.3 -c -gnat05 subjects.adb
subjects.ads:9:49: premature use of incomplete type
subjects.ads:9:49: instantiation abandoned


-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=29015



[Bug ada/29015] Ada 2005 observer pattern with mutually dependent packages and containers produces compiler error

2008-04-09 Thread ludovic at ludovic-brenta dot org


--- Comment #7 from ludovic at ludovic-brenta dot org  2008-04-09 20:25 
---
Further reduced test case: replace observers.ads with:

package Observers is
   type Observer is new Integer;
   type Observer_Access is access Observer;
end Observers;

and the bug is still there.


-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=29015



[Bug ada/29015] Ada 2005 observer pattern with mutually dependent packages and containers produces compiler error

2008-04-09 Thread sam at gcc dot gnu dot org


--- Comment #8 from sam at gcc dot gnu dot org  2008-04-09 20:40 ---
Yes, the bug manifests when the view on the type is limited at this point *but*
we know the underlying type (because of a non-limited with for example). This
triggers it if you compile p2.adb:

package P1 is
   type T is null record;
end P1;
limited with P1;
package P2 is
   pragma Elaborate_Body;
   generic
  type T is private;
   package G is end G;
   package I1 is new G (P1.T);
end P2;
with P1;
package body P2 is end P2;

I'm testing a fix.


-- 

sam at gcc dot gnu dot org changed:

   What|Removed |Added

 AssignedTo|unassigned at gcc dot gnu   |sam at gcc dot gnu dot org
   |dot org |
 Status|NEW |ASSIGNED
   Last reconfirmed|2007-12-07 14:01:58 |2008-04-09 20:40:46
   date||


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=29015



[Bug ada/29015] Ada 2005 observer pattern with mutually dependent packages and containers produces compiler error

2007-12-07 Thread sam at gcc dot gnu dot org


--- Comment #4 from sam at gcc dot gnu dot org  2007-12-07 14:01 ---
Confirmed on SVN trunk

+===GNAT BUG DETECTED==+
| 4.3.0 20071207 (experimental) (i686-pc-linux-gnu) Assert_Failure
atree.adb:962|
| Error detected at subjects.ads:19:3  |


-- 

sam at gcc dot gnu dot org changed:

   What|Removed |Added

 CC||sam at gcc dot gnu dot org
   Last reconfirmed|2006-09-18 17:55:33 |2007-12-07 14:01:58
   date||


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=29015



[Bug ada/29015] Ada 2005 observer pattern with mutually dependent packages and containers produces compiler error

2006-09-18 Thread laguest at archangeli dot demon dot co dot uk


--- Comment #2 from laguest at archangeli dot demon dot co dot uk  
2006-09-18 16:11 ---
Seems this was an error based on the use of a limited view of a type. I don't
know whether this is actually allowed in the Ada 2005 standard, i.e passing a
reference to a limited view to a container? Should this bug be left open?

Luke.


-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=29015



[Bug ada/29015] Ada 2005 observer pattern with mutually dependent packages and containers produces compiler error

2006-09-18 Thread laurent at guerby dot net


--- Comment #3 from laurent at guerby dot net  2006-09-18 17:55 ---
Confirmed.

$ gcc -c -gnat05 test_observers.adb
+===GNAT BUG DETECTED==+
| 4.2.0 20060915 (experimental) (x86_64-unknown-linux-gnu) Assert_Failure
atree.adb:812|
| Error detected at subjects.ads:19:3  |

I'm not sure this is valid too, so I'm tagging this as ICE on invalid code (in
all cases this is a bug since the compiler should never ICE).


-- 

laurent at guerby dot net changed:

   What|Removed |Added

 Status|UNCONFIRMED |NEW
 Ever Confirmed|0   |1
   Keywords||ice-on-invalid-code
   Last reconfirmed|-00-00 00:00:00 |2006-09-18 17:55:33
   date||


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=29015



[Bug ada/29015] Ada 2005 observer pattern with mutually dependent packages and containers produces compiler error

2006-09-17 Thread laguest at archangeli dot demon dot co dot uk


--- Comment #1 from laguest at archangeli dot demon dot co dot uk  
2006-09-17 19:42 ---
Using the current SVN source (17/09/06) I get a slightly different error (with
the same source):

gcc -c -gnat05 test_observers.adb
+===GNAT BUG DETECTED==+
| 4.2.0 20060917 (experimental) (i686-pc-linux-gnu) Assert_Failure
atree.adb:812|
| Error detected at subjects.ads:17:3  |
| Please submit a bug report; see http://gcc.gnu.org/bugs.html.|
| Use a subject line meaningful to you and us to track the bug.|
| Include the entire contents of this bug box in the report.   |
| Include the exact gcc or gnatmake command that you entered.  |
| Also include sources listed below in gnatchop format |
| (concatenated together with no headers between files).   |
+==+

Please include these source files with error report
Note that list may not be accurate in some cases,
so please double check that the problem can still
be reproduced with the set of files listed.

test_observers.adb
my_observer.ads
observers.ads
subjects.ads

compilation abandoned
gnatmake: test_observers.adb compilation error


-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=29015



[Bug ada/29015] Ada 2005 observer pattern with mutually dependent packages and containers produces compiler error

2006-09-14 Thread ebotcazou at gcc dot gnu dot org


-- 

ebotcazou at gcc dot gnu dot org changed:

   What|Removed |Added

   Severity|blocker |normal


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=29015