aboutsummaryrefslogtreecommitdiff
path: root/gcc/ada/adadecode.c
diff options
context:
space:
mode:
authorSteve Baird <baird@adacore.com>2024-07-08 14:02:15 -0700
committerMarc Poulhiès <dkm@gcc.gnu.org>2024-08-02 09:08:05 +0200
commite2fe0b18a66aafdd489ba9dbf148794906732f64 (patch)
tree1342ac68bed2af810ffb088fbeec0f9ef4cb361a /gcc/ada/adadecode.c
parenta846b4cfc7383e7a2550993cbf669b94db838069 (diff)
downloadgcc-e2fe0b18a66aafdd489ba9dbf148794906732f64.zip
gcc-e2fe0b18a66aafdd489ba9dbf148794906732f64.tar.gz
gcc-e2fe0b18a66aafdd489ba9dbf148794906732f64.tar.bz2
ada: Reject illegal uses of type/subtype current instance
The current instance of a type or subtype (see RM 8.6) is an object or value, not a type or subtype. So a name denoting such a current instance is illegal in any context that requires a name denoting a type or subtype. In some cases this error was not detected. gcc/ada/ * sem_ch8.adb (Find_Type): If Is_Current_Instance returns True for N (and Comes_From_Source (N) is also True) then flag an error. Call Is_Current_Instance (twice) instead of duplicating (twice) N_Access_Definition-related code in Is_Current_Instance. * sem_util.adb (Is_Current_Instance): Implement access-type-related clauses of the RM 8.6 current instance rule. For pragmas Predicate and Predicate_Failure, distinguish between the first and subsequent pragma arguments.
Diffstat (limited to 'gcc/ada/adadecode.c')
0 files changed, 0 insertions, 0 deletions