summaryrefslogtreecommitdiff
path: root/gcc/ada/sem_intr.adb
diff options
context:
space:
mode:
authorbstarynk <bstarynk@138bc75d-0d04-0410-961f-82ee72b054a4>2009-07-22 17:58:10 +0000
committerbstarynk <bstarynk@138bc75d-0d04-0410-961f-82ee72b054a4>2009-07-22 17:58:10 +0000
commitedbab208cf506c660d37346f43c5a2efa8528066 (patch)
treed003b4617eeb2ffd00a15cd15a40470fa4dee5a9 /gcc/ada/sem_intr.adb
parent581b7a3847963e186af616e9b6a7390d120881d3 (diff)
downloadgcc-edbab208cf506c660d37346f43c5a2efa8528066.tar.gz
2009-07-22 Basile Starynkevitch <basile@starynkevitch.net>
MELT branch merged with trunk rev 149945 git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/branches/melt-branch@149950 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/ada/sem_intr.adb')
-rw-r--r--gcc/ada/sem_intr.adb10
1 files changed, 7 insertions, 3 deletions
diff --git a/gcc/ada/sem_intr.adb b/gcc/ada/sem_intr.adb
index 0b7adc45224..42136b13ee8 100644
--- a/gcc/ada/sem_intr.adb
+++ b/gcc/ada/sem_intr.adb
@@ -6,7 +6,7 @@
-- --
-- B o d y --
-- --
--- Copyright (C) 1992-2008, Free Software Foundation, Inc. --
+-- Copyright (C) 1992-2009, 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- --
@@ -102,7 +102,9 @@ package body Sem_Intr is
Arg1 : constant Node_Id := First_Actual (N);
begin
- -- For Import_xxx calls, argument must be static string
+ -- For Import_xxx calls, argument must be static string. A string
+ -- literal is legal even in Ada83 mode, where such literals are
+ -- not static.
if Cnam = Name_Import_Address
or else
@@ -115,7 +117,9 @@ package body Sem_Intr is
then
null;
- elsif not Is_Static_Expression (Arg1) then
+ elsif Nkind (Arg1) /= N_String_Literal
+ and then not Is_Static_Expression (Arg1)
+ then
Error_Msg_FE
("call to & requires static string argument!", N, Nam);
Why_Not_Static (Arg1);