[multiple changes]

2010-06-22  Ed Schonberg  <schonberg@adacore.com>

	* uintp.adb: Fix scope error in operator call.

2010-06-22  Vincent Celier  <celier@adacore.com>

	* makeutl.adb (Executable_Prefix_Path): on VMS, return "/gnu/".
	* prj-conf.adb (Get_Or_Create_Configuration_File): On VMS, if
	autoconfiguration is needed, fail indicating that no config project
	file can be found, as there is no autoconfiguration on VMS.

2010-06-22  Ed Schonberg  <schonberg@adacore.com>

	* sem_res.adb (Make_Call_Into_Operator): Diagnose an incorrect scope
	for an operator in a functional notation, when operands are universal.

From-SVN: r161147
This commit is contained in:
Arnaud Charlet 2010-06-22 10:40:51 +02:00
parent 29214696c8
commit 88b17d4506
5 changed files with 65 additions and 6 deletions

View File

@ -1,3 +1,19 @@
2010-06-22 Ed Schonberg <schonberg@adacore.com>
* uintp.adb: Fix scope error in operator call.
2010-06-22 Vincent Celier <celier@adacore.com>
* makeutl.adb (Executable_Prefix_Path): on VMS, return "/gnu/".
* prj-conf.adb (Get_Or_Create_Configuration_File): On VMS, if
autoconfiguration is needed, fail indicating that no config project
file can be found, as there is no autoconfiguration on VMS.
2010-06-22 Ed Schonberg <schonberg@adacore.com>
* sem_res.adb (Make_Call_Into_Operator): Diagnose an incorrect scope
for an operator in a functional notation, when operands are universal.
2010-06-22 Arnaud Charlet <charlet@adacore.com> 2010-06-22 Arnaud Charlet <charlet@adacore.com>
* gcc-interface/Make-lang.in: Update dependencies. * gcc-interface/Make-lang.in: Update dependencies.

View File

@ -6,7 +6,7 @@
-- -- -- --
-- B o d y -- -- B o d y --
-- -- -- --
-- Copyright (C) 2004-2009, Free Software Foundation, Inc. -- -- Copyright (C) 2004-2010, Free Software Foundation, Inc. --
-- -- -- --
-- GNAT is free software; you can redistribute it and/or modify it under -- -- 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- -- -- terms of the GNU General Public License as published by the Free Soft- --
@ -26,6 +26,7 @@
with ALI; use ALI; with ALI; use ALI;
with Debug; with Debug;
with Fname; with Fname;
with Hostparm;
with Osint; use Osint; with Osint; use Osint;
with Output; use Output; with Output; use Output;
with Opt; use Opt; with Opt; use Opt;
@ -378,6 +379,12 @@ package body Makeutl is
-- Beginning of Executable_Prefix_Path -- Beginning of Executable_Prefix_Path
begin begin
-- For VMS, the path returned is always /gnu/
if Hostparm.OpenVMS then
return "/gnu/";
end if;
-- First determine if a path prefix was placed in front of the -- First determine if a path prefix was placed in front of the
-- executable name. -- executable name.

View File

@ -6,7 +6,7 @@
-- -- -- --
-- B o d y -- -- B o d y --
-- -- -- --
-- Copyright (C) 2006-2009, Free Software Foundation, Inc. -- -- Copyright (C) 2006-2010, Free Software Foundation, Inc. --
-- -- -- --
-- GNAT is free software; you can redistribute it and/or modify it under -- -- 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- -- -- terms of the GNU General Public License as published by the Free Soft- --
@ -25,6 +25,7 @@
with Ada.Directories; use Ada.Directories; with Ada.Directories; use Ada.Directories;
with GNAT.HTable; use GNAT.HTable; with GNAT.HTable; use GNAT.HTable;
with Hostparm;
with Makeutl; use Makeutl; with Makeutl; use Makeutl;
with MLib.Tgt; with MLib.Tgt;
with Opt; use Opt; with Opt; use Opt;
@ -889,8 +890,18 @@ package body Prj.Conf is
<<Process_Config_File>> <<Process_Config_File>>
if Automatically_Generated then if Automatically_Generated then
-- This might raise an Invalid_Config exception if Hostparm.OpenVMS then
Do_Autoconf;
-- There is no gprconfig on VMS
raise Invalid_Config
with "could not locate any configuration project file";
else
-- This might raise an Invalid_Config exception
Do_Autoconf;
end if;
end if; end if;
-- Parse the configuration file -- Parse the configuration file

View File

@ -1422,6 +1422,31 @@ package body Sem_Res is
("& not declared in&", N, Selector_Name (Name (N))); ("& not declared in&", N, Selector_Name (Name (N)));
Set_Etype (N, Any_Type); Set_Etype (N, Any_Type);
return; return;
-- Detect a mismatch between the context type and the result type
-- in the named package, which is otherwise not detected if the
-- operands are universal. Check is only needed if source entity is
-- an operator, not a function that renames an operator.
elsif Nkind (Parent (N)) /= N_Type_Conversion
and then Ekind (Entity (Name (N))) = E_Operator
and then Is_Numeric_Type (Typ)
and then not Is_Universal_Numeric_Type (Typ)
and then Scope (Base_Type (Typ)) /= Pack
and then not In_Instance
then
if Is_Fixed_Point_Type (Typ)
and then (Op_Name = Name_Op_Multiply
or else
Op_Name = Name_Op_Divide)
then
-- Already checked above
null;
else
Error_Msg_NE ("expect type&", N, Typ);
end if;
end if; end if;
end if; end if;

View File

@ -6,7 +6,7 @@
-- -- -- --
-- B o d y -- -- B o d y --
-- -- -- --
-- Copyright (C) 1992-2009, Free Software Foundation, Inc. -- -- Copyright (C) 1992-2010, Free Software Foundation, Inc. --
-- -- -- --
-- GNAT is free software; you can redistribute it and/or modify it under -- -- 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- -- -- terms of the GNU General Public License as published by the Free Soft- --
@ -239,7 +239,7 @@ package body Uintp is
function Hash_Num (F : Int) return Hnum is function Hash_Num (F : Int) return Hnum is
begin begin
return Standard."mod" (F, Hnum'Range_Length); return Types."mod" (F, Hnum'Range_Length);
end Hash_Num; end Hash_Num;
--------------- ---------------