This patch fixes a spurious error during the construction of an instance body in the inlining phase of the frontend, when the package declaration for the main unit has a limited_with_clause on some unit P, and the main unit itself does not have a corresponding regular with_clause, but some other unit in the context has with_clause that has compiled P. P must be removed from visibility to prevent conflicts with homonyms in the generic body to be instantiated. The following must compile quietly: gcc -c gpr2-project-view.adb ---- package GNATCOLL is end GNATCOLL; package GNATCOLL.Refcount is generic type Element_Type (<>) is private; package Shared_Pointers is type Ref is tagged private; type Element_Access is access all Element_Type; type Reference_Type (Element : access Element_Type) is limited null record; function Unchecked_Get (Self : Ref'Class) return Element_Access; function Get (Self : Ref'Class) return Reference_Type is ((Element => Unchecked_Get (Self))); private type Ref is tagged null record; end Shared_Pointers; type Refcounted is abstract tagged null record; generic type Encapsulated is abstract new Refcounted with private; package Smart_Pointers is type Encapsulated_Access is access all Encapsulated'Class; type Ref is tagged private; procedure Set (Self : in out Ref; Data : Encapsulated'Class); procedure Set (Self : in out Ref; Data : access Encapsulated'Class); private type Ref is tagged null record; end Smart_Pointers; end GNATCOLL.Refcount; ---- package body GNATCOLL.Refcount is package body Shared_Pointers is function Unchecked_Get (Self : Ref'Class) return Element_Access is begin return null; end Unchecked_Get; end Shared_Pointers; package body Smart_Pointers is procedure Set (Self : in out Ref; Data : access Encapsulated'Class) is begin null; end Set; procedure Set (Self : in out Ref; Data : Encapsulated'Class) is Tmp : constant Encapsulated_Access := new Encapsulated'Class'(Data); begin Set (Self, Tmp); end Set; end Smart_Pointers; end GNATCOLL.Refcount; ---- package GPR2 is end GPR2; ---- package GPR2.Parser is end GPR2.Parser; ---- with GPR_Parser.Analysis; package GPR2.Parser.Project is end GPR2.Parser.Project; ---- package GPR2.Project is end GPR2.Project; ---- with GPR2.Parser.Project; package GPR2.Project.Configuration is end GPR2.Project.Configuration; ---- with GPR2.Project.Configuration; with GPR2.Unit.Set; package GPR2.Project.Definition is end GPR2.Project.Definition; ---- limited with GPR2.Unit.Set; package GPR2.Project.View is procedure Require_Body; end GPR2.Project.View; ---- with GPR2.Project.Definition; package body GPR2.Project.View is procedure Require_Body is null; end GPR2.Project.View; ---- package GPR2.Unit is end GPR2.Unit; package GPR2.Unit.Set is end GPR2.Unit.Set; ... package GPR_Parser is end GPR_Parser; ---- with GNATCOLL.Refcount; package GPR_Parser.Analysis is type Unit_Provider_Interface is null record; package Unit_Provider_References is new GNATCOLL.Refcount.Shared_Pointers (Unit_Provider_Interface); end GPR_Parser.Analysis; 2019-07-04 Ed Schonberg <schonberg@adacore.com> gcc/ada/ * sem_ch10.adb (Remove_Context_Clauses): Handle properly the removal of a limited_with_clause which appears in the library unit oF the main unit, when some other unit in the context has a regular with_clause on the same unit, to prevent spurious visibility errors in the subsequent analysis of pending instance bodies. From-SVN: r273067
Name |
Last commit
|
Last update |
---|---|---|
INSTALL | Loading commit data... | |
config | Loading commit data... | |
contrib | Loading commit data... | |
fixincludes | Loading commit data... | |
gcc | Loading commit data... | |
gnattools | Loading commit data... | |
gotools | Loading commit data... | |
include | Loading commit data... | |
intl | Loading commit data... | |
libada | Loading commit data... | |
libatomic | Loading commit data... | |
libbacktrace | Loading commit data... | |
libcc1 | Loading commit data... | |
libcpp | Loading commit data... | |
libdecnumber | Loading commit data... | |
libffi | Loading commit data... | |
libgcc | Loading commit data... | |
libgfortran | Loading commit data... | |
libgo | Loading commit data... | |
libgomp | Loading commit data... | |
libhsail-rt | Loading commit data... | |
libiberty | Loading commit data... | |
libitm | Loading commit data... | |
libobjc | Loading commit data... | |
liboffloadmic | Loading commit data... | |
libphobos | Loading commit data... | |
libquadmath | Loading commit data... | |
libsanitizer | Loading commit data... | |
libssp | Loading commit data... | |
libstdc++-v3 | Loading commit data... | |
libvtv | Loading commit data... | |
lto-plugin | Loading commit data... | |
maintainer-scripts | Loading commit data... | |
zlib | Loading commit data... | |
.dir-locals.el | Loading commit data... | |
.gitattributes | Loading commit data... | |
.gitignore | Loading commit data... | |
ABOUT-NLS | Loading commit data... | |
COPYING | Loading commit data... | |
COPYING.LIB | Loading commit data... | |
COPYING.RUNTIME | Loading commit data... | |
COPYING3 | Loading commit data... | |
COPYING3.LIB | Loading commit data... | |
ChangeLog | Loading commit data... | |
ChangeLog.jit | Loading commit data... | |
ChangeLog.tree-ssa | Loading commit data... | |
MAINTAINERS | Loading commit data... | |
Makefile.def | Loading commit data... | |
Makefile.in | Loading commit data... | |
Makefile.tpl | Loading commit data... | |
README | Loading commit data... | |
ar-lib | Loading commit data... | |
compile | Loading commit data... | |
config-ml.in | Loading commit data... | |
config.guess | Loading commit data... | |
config.rpath | Loading commit data... | |
config.sub | Loading commit data... | |
configure | Loading commit data... | |
configure.ac | Loading commit data... | |
depcomp | Loading commit data... | |
install-sh | Loading commit data... | |
libtool-ldflags | Loading commit data... | |
libtool.m4 | Loading commit data... | |
ltgcc.m4 | Loading commit data... | |
ltmain.sh | Loading commit data... | |
ltoptions.m4 | Loading commit data... | |
ltsugar.m4 | Loading commit data... | |
ltversion.m4 | Loading commit data... | |
lt~obsolete.m4 | Loading commit data... | |
missing | Loading commit data... | |
mkdep | Loading commit data... | |
mkinstalldirs | Loading commit data... | |
move-if-change | Loading commit data... | |
multilib.am | Loading commit data... | |
symlink-tree | Loading commit data... | |
test-driver | Loading commit data... | |
ylwrap | Loading commit data... |