aboutsummaryrefslogtreecommitdiff
path: root/gcc/ada/sem_ch3.adb
diff options
context:
space:
mode:
authorHristian Kirtchev <kirtchev@adacore.com>2016-04-18 10:27:19 +0000
committerArnaud Charlet <charlet@gcc.gnu.org>2016-04-18 12:27:19 +0200
commit070d862dde98557eab8c9ecb0adb4ca504503777 (patch)
tree2967e9cd16a2787a48b40745c952d20453470d19 /gcc/ada/sem_ch3.adb
parent933aa0ac81ee62b104969294ce6ab117e1602968 (diff)
downloadgcc-070d862dde98557eab8c9ecb0adb4ca504503777.zip
gcc-070d862dde98557eab8c9ecb0adb4ca504503777.tar.gz
gcc-070d862dde98557eab8c9ecb0adb4ca504503777.tar.bz2
sem_ch3.adb (Analyze_Object_Declaration): Do not consider internally generated expressions when...
2016-04-18 Hristian Kirtchev <kirtchev@adacore.com> * sem_ch3.adb (Analyze_Object_Declaration): Do not consider internally generated expressions when trying to determine whether a formal parameter of a tagged type subject to Extensions_Visible False is used to initialize an object. * sem_ch4.adb (Analyze_Type_Conversion): Do not consider internally generated expressions when trying to determine whether a formal parameter of a tagged type subject to Extensions_Visible False is used in a type conversion. From-SVN: r235117
Diffstat (limited to 'gcc/ada/sem_ch3.adb')
-rw-r--r--gcc/ada/sem_ch3.adb8
1 files changed, 6 insertions, 2 deletions
diff --git a/gcc/ada/sem_ch3.adb b/gcc/ada/sem_ch3.adb
index d401bd1..56e8a74 100644
--- a/gcc/ada/sem_ch3.adb
+++ b/gcc/ada/sem_ch3.adb
@@ -3776,9 +3776,13 @@ package body Sem_Ch3 is
-- A formal parameter of a specific tagged type whose related
-- subprogram is subject to pragma Extensions_Visible with value
-- "False" cannot be implicitly converted to a class-wide type by
- -- means of an initialization expression (SPARK RM 6.1.7(3)).
+ -- means of an initialization expression (SPARK RM 6.1.7(3)). Do
+ -- not consider internally generated expressions.
- if Is_Class_Wide_Type (T) and then Is_EVF_Expression (E) then
+ if Is_Class_Wide_Type (T)
+ and then Comes_From_Source (E)
+ and then Is_EVF_Expression (E)
+ then
Error_Msg_N
("formal parameter with Extensions_Visible False cannot be "
& "implicitly converted to class-wide type", E);