]> git.ipfire.org Git - thirdparty/gcc.git/commit
ada: Better error message if non-Ada2022 code declares No_Return function
authorSteve Baird <baird@adacore.com>
Mon, 30 Jan 2023 23:41:48 +0000 (15:41 -0800)
committerMarc Poulhiès <poulhies@adacore.com>
Mon, 22 May 2023 08:44:08 +0000 (10:44 +0200)
commite1f5cf0b14c460f04e878e8c52c90132f19c5e3f
tree4e972f9ce8cb1302977da4117612bb247d3f07d1
parent60498ae3a06ba9a08cd2bf4a851e01e7e6fb1557
ada: Better error message if non-Ada2022 code declares No_Return function

When a feature that is legal in Ada2022 but not in earlier Ada versions
is used, we typically want to call Error_Msg_Ada_2022_Feature in order to
generate an informative message in the error case. Specifying No_Return
for a function (as opposed to a procedure) is no exception to this rule.

gcc/ada/

* sem_prag.adb (Analyze_Pragma): In Check_No_Return, call
Error_Msg_Ada_2022_Feature in the case of a function. Remove code
outside of Check_No_Return that was querying Ada_Version.
gcc/ada/sem_prag.adb