+2018-01-11 Hristian Kirtchev <kirtchev@adacore.com>
+
+ * sem_ch6.adb (Analyze_Subprogram_Body_Helper): Check the
+ categorization of a subprogram body which does not complete a previous
+ declaration.
+
2018-01-11 Hristian Kirtchev <kirtchev@adacore.com>
* sem_ch10.adb (Check_Private_Child_Unit): Ensure that the enclosing
-- --
-- B o d y --
-- --
--- Copyright (C) 1992-2017, Free Software Foundation, Inc. --
+-- Copyright (C) 1992-2018, Free Software Foundation, Inc. --
-- --
-- GNAT is free software; you can redistribute it and/or modify it under --
-- terms of the GNU General Public License as published by the Free Soft- --
Set_First_Entity (Spec_Id, Empty);
Set_Last_Entity (Spec_Id, Empty);
end if;
+
+ -- Otherwise the body does not complete a previous declaration. Check
+ -- the categorization of the body against the units it withs.
+
+ else
+ Validate_Categorization_Dependency (N, Body_Id);
end if;
Check_Missing_Return;
+2018-01-11 Hristian Kirtchev <kirtchev@adacore.com>
+
+ * gnat.dg/pure_subp_body.adb, gnat.dg/pure_subp_body_pkg.ads: New
+ testcase.
+
2018-01-11 Bob Duff <duff@adacore.com>
* gnat.dg/protected_null.adb: New testcase.
--- /dev/null
+-- { dg-do compile }
+
+with Pure_Subp_Body_Pkg;
+
+procedure Pure_Subp_Body with Pure is
+begin
+ null;
+end Pure_Subp_Body;
+
+-- cannot depend on "Pure_Subp_Body_Pkg" (wrong categorization)
+-- { dg-error "cannot depend on \"Pure_Subp_Body_Pkg\" \\(wrong categorization\\)" "" { target *-*-* } 3 }
+-- { dg-error "pure unit cannot depend on non-pure unit" "non-pure unit" { target *-*-* } 3 }
--- /dev/null
+package Pure_Subp_Body_Pkg is
+end Pure_Subp_Body_Pkg;