2008-08-04 Robert Dewar <dewar@adacore.com>
authorRobert Dewar <dewar@adacore.com>
Mon, 4 Aug 2008 12:51:19 +0000 (14:51 +0200)
committerArnaud Charlet <charlet@gcc.gnu.org>
Mon, 4 Aug 2008 12:51:19 +0000 (14:51 +0200)
* freeze.adb:
(Freeze_Entity): Only check No_Default_Initialization restriction for
constructs that come from source

From-SVN: r138617

gcc/ada/freeze.adb

index a2dd517c509cfdc78d6474555c46fc34100a1662..dffcbaf3b403455f33e713c405286bebb58f2c20 100644 (file)
@@ -2665,7 +2665,8 @@ package body Freeze is
                --  ever default initialized, and is why the check is deferred
                --  until freezing, at which point we know if Import applies.
 
-               if not Is_Imported (E)
+               if Comes_From_Source (E)
+                 and then not Is_Imported (E)
                  and then not Has_Init_Expression (Declaration_Node (E))
                  and then
                    ((Has_Non_Null_Base_Init_Proc (Etype (E))