aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSamuel Tardieu <sam@rfc1149.net>2008-04-14 13:41:25 +0000
committerSamuel Tardieu <sam@gcc.gnu.org>2008-04-14 13:41:25 +0000
commit32f7efe1a5140f2b95f62009c2a0315a1ada2c5f (patch)
treea0e5eb6d8c22916e37633735e87dd448b9eccc42
parentb039b10e28c986b8099ad6e013d6426387667a48 (diff)
downloadgcc-32f7efe1a5140f2b95f62009c2a0315a1ada2c5f.zip
gcc-32f7efe1a5140f2b95f62009c2a0315a1ada2c5f.tar.gz
gcc-32f7efe1a5140f2b95f62009c2a0315a1ada2c5f.tar.bz2
re PR ada/18680 (pragma Linker_Section problems)
gcc/ada/ PR ada/18680 * sem_prag.adb (Analyze_Pragma, Linker_Section case): Refuse to apply pragma Linker_Section on type. gcc/testsuite/ PR ada/18680 * gnat.dg/specs/linker_section.ads: New. From-SVN: r134266
-rw-r--r--gcc/ada/ChangeLog6
-rw-r--r--gcc/ada/sem_prag.adb6
-rw-r--r--gcc/testsuite/ChangeLog5
-rw-r--r--gcc/testsuite/gnat.dg/specs/linker_section.ads10
4 files changed, 27 insertions, 0 deletions
diff --git a/gcc/ada/ChangeLog b/gcc/ada/ChangeLog
index cdfcdfe..5d37a15 100644
--- a/gcc/ada/ChangeLog
+++ b/gcc/ada/ChangeLog
@@ -1,5 +1,11 @@
2008-04-14 Samuel Tardieu <sam@rfc1149.net>
+ PR ada/18680
+ * sem_prag.adb (Analyze_Pragma, Linker_Section case): Refuse to
+ apply pragma Linker_Section on type.
+
+2008-04-14 Samuel Tardieu <sam@rfc1149.net>
+
PR ada/16098
* sem_prag.adb (Error_Pragma_Ref): New.
(Process_Convention): Specialized message for non-local
diff --git a/gcc/ada/sem_prag.adb b/gcc/ada/sem_prag.adb
index 8a9a2e9..c238367 100644
--- a/gcc/ada/sem_prag.adb
+++ b/gcc/ada/sem_prag.adb
@@ -8450,6 +8450,12 @@ package body Sem_Prag is
Check_Arg_Is_Library_Level_Local_Name (Arg1);
Check_Arg_Is_Static_Expression (Arg2, Standard_String);
+ -- This pragma does not apply to types
+
+ if Is_Type (Entity (Expression (Arg1))) then
+ Error_Pragma_Arg ("pragma% cannot apply to type", Arg1);
+ end if;
+
-- The only processing required is to link this item on to the
-- list of rep items for the given entity. This is accomplished
-- by the call to Rep_Item_Too_Late (when no error is detected
diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog
index 5bb51e8..8af67f7 100644
--- a/gcc/testsuite/ChangeLog
+++ b/gcc/testsuite/ChangeLog
@@ -1,5 +1,10 @@
2008-04-14 Samuel Tardieu <sam@rfc1149.net>
+ PR ada/18680
+ * gnat.dg/specs/linker_section.ads: New.
+
+2008-04-14 Samuel Tardieu <sam@rfc1149.net>
+
PR ada/16098
* gnat.dg/specs/renamings.ads: New.
diff --git a/gcc/testsuite/gnat.dg/specs/linker_section.ads b/gcc/testsuite/gnat.dg/specs/linker_section.ads
new file mode 100644
index 0000000..ae2d402
--- /dev/null
+++ b/gcc/testsuite/gnat.dg/specs/linker_section.ads
@@ -0,0 +1,10 @@
+package Linker_Section is
+ Data1 : constant String := "12345678901234567";
+ pragma Linker_Section (Entity => Data1,
+ Section => ".eeprom");
+ type EEPROM_String is new String;
+ pragma Linker_Section (Entity => EEPROM_String, -- { dg-error "type" }
+ Section => ".eeprom");
+ Data2 : constant EEPROM_String := "12345678901234567";
+end Linker_Section;
+