This is the mail archive of the gcc-patches@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]

[Ada] Missing error in function expressions


The compiler skips reporting errors located in function expressions.
After this patch the error is reported in the following sources:

package Base is
   type Base_Type is tagged record
      V : Integer;
   end record;

   function Func_1 (B : Base_Type) return Integer is (B.V);
end;

with Base;
package DB is
   type DB_Type is new Base.Base_Type with record
      Y : Integer;
   end record;

   overriding
   function Func_1 (B : DB_Type) return Integer;

private
   function Func_1 (B : DB_Type) return Integer is
     (Base.Func_1 (Base_Type (B)) / 8 * 4);     -- Error
end;

Command: gcc -c db.ads
Output:
  db.ads:13:20: "Base_Type" is not visible
  db.ads:13:20: non-visible declaration at base.ads:2

Tested on x86_64-pc-linux-gnu, committed on trunk

2017-09-08  Javier Miranda  <miranda@adacore.com>

	* sem_ch8.adb (Find_Direct_Name.Undefined): Do
	not add entries into the undefined reference table when we are
	compiling with errors ignored.

Attachment: difs
Description: Text document


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