This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug ada/18227] New: incomplete type in private part of inner package visible in outer package


An incomplete type declared in the private part of a nested
package can be used in the declaration of an access type in the
enclosing package. This goes unnoticed.
 The compiler seems to notice this if and only if the incomplete
type is used in the definition of something else (I guess).
For example in an attempt to make a subtype or derived type or,
as in the lines commented below, when it is used as a function's
return type.

package Outer is

   package Inner is
   private
      type TI;
   end Inner;

   type T is access all Inner.TI;  -- no complaint!

private
   type TP is access all Inner.TI;  -- no complaint!
end Outer;


package body Outer is

   package body Inner is
      type TI is null record;
   end Inner;

--     function trigger return Inner.TI is -- o.K., complaint
--     begin
--        return null record;
--     end trigger;

end Outer;

-- regards, Georg

-- 
           Summary: incomplete type in private part of inner package visible
                    in outer package
           Product: gcc
           Version: 3.4.3
            Status: UNCONFIRMED
          Severity: normal
          Priority: P2
         Component: ada
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: bauhaus at futureapps dot de
                CC: gcc-bugs at gcc dot gnu dot org
  GCC host triplet: i686-pc-linux-gnu


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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]