summaryrefslogtreecommitdiff
path: root/gcc/ada/sem_attr.adb
diff options
context:
space:
mode:
authorcharlet <charlet@138bc75d-0d04-0410-961f-82ee72b054a4>2017-01-06 11:24:02 +0000
committercharlet <charlet@138bc75d-0d04-0410-961f-82ee72b054a4>2017-01-06 11:24:02 +0000
commit180e56c58faef3c8c698feaf6595652df0c6eb8d (patch)
tree7f03c7a1cc81cdacb953ca528df650d4eb61fde6 /gcc/ada/sem_attr.adb
parent84a979222ca294ed6c39b3fca23b91deabcbcbed (diff)
downloadgcc-180e56c58faef3c8c698feaf6595652df0c6eb8d.tar.gz
2017-01-06 Ed Schonberg <schonberg@adacore.com>
* exp_ch6.adb (Expand_Protected_Subprogram_Call): Add guard to better detect call within an entry_wrapper. * sem_res.adb (Resolve_Call): A protected call within an entity_wrapper is analyzed in the context of the protected object but corresponds to a pre-analysis and is not an access before elaboration. * sem_attr.adb: Minor reformatting. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@244139 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/ada/sem_attr.adb')
-rw-r--r--gcc/ada/sem_attr.adb23
1 files changed, 14 insertions, 9 deletions
diff --git a/gcc/ada/sem_attr.adb b/gcc/ada/sem_attr.adb
index 8d883383d54..91d740a17ec 100644
--- a/gcc/ada/sem_attr.adb
+++ b/gcc/ada/sem_attr.adb
@@ -3840,24 +3840,29 @@ package body Sem_Attr is
when Attribute_Finalization_Size =>
Check_E0;
+ -- The prefix denotes an object
+
if Is_Object_Reference (P) then
Analyze_And_Resolve (P);
Check_Object_Reference (P);
- -- Redundant type verification for accurate error output
+ -- Check the prefix is a type to avoid an error message stating the
+ -- prefix must exclusively denote one
+
+ elsif Is_Entity_Name (P) and then Is_Type (Entity (P)) then
- elsif not Is_Entity_Name (P)
- or else not Is_Type (Entity (P))
- then
- Error_Attr_P ("prefix of % attribute must be a definite type or" &
- " an object");
- else
Check_Type;
Check_Not_Incomplete_Type;
if Is_Class_Wide_Type (Etype (P)) then
- Error_Attr_P ("prefix of % attribute cannot be applied to " &
- "a class-wide type");
+ Error_Attr_P
+ ("prefix of % attribute cannot denote a class-wide type");
end if;
+
+ -- The prefix does not denote an object or a type
+
+ else
+ Error_Attr_P
+ ("prefix of % attribute must be a definite type or an object");
end if;
Set_Etype (N, Universal_Integer);