Commit 35e0295
committed
Ada: Fix qualified name of discriminant incorrectly accepted in constraint
The RM 3.8(12/3) subclause says that a discriminant mentioned in a
constraint must appear alone as a direct name. The last part is not
consistently checked and, while the first part is, it generates a
slightly different error message depending on the form of the input.
This fixes the last part and changes the first to use a single message.
gcc/ada/
PR ada/35793
* sem_res.adb (Check_Discriminant_Use): In a constraint context,
check that the discriminant appears alone as a direct name in all
cases and give a consistent error message when it does not.
gcc/testsuite/
* gnat.dg/specs/discr8.ads: New test.1 parent 90f2ab4 commit 35e0295
2 files changed
+39
-27
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
658 | 658 | | |
659 | 659 | | |
660 | 660 | | |
| 661 | + | |
| 662 | + | |
| 663 | + | |
| 664 | + | |
| 665 | + | |
| 666 | + | |
| 667 | + | |
| 668 | + | |
| 669 | + | |
| 670 | + | |
| 671 | + | |
| 672 | + | |
| 673 | + | |
| 674 | + | |
| 675 | + | |
| 676 | + | |
| 677 | + | |
| 678 | + | |
661 | 679 | | |
662 | 680 | | |
663 | 681 | | |
| |||
694 | 712 | | |
695 | 713 | | |
696 | 714 | | |
697 | | - | |
698 | | - | |
699 | | - | |
700 | | - | |
701 | | - | |
702 | | - | |
703 | | - | |
704 | | - | |
705 | | - | |
706 | | - | |
707 | | - | |
708 | | - | |
709 | | - | |
| 715 | + | |
| 716 | + | |
| 717 | + | |
| 718 | + | |
| 719 | + | |
710 | 720 | | |
711 | 721 | | |
712 | 722 | | |
| |||
817 | 827 | | |
818 | 828 | | |
819 | 829 | | |
820 | | - | |
821 | | - | |
822 | | - | |
823 | | - | |
824 | | - | |
825 | | - | |
826 | | - | |
827 | | - | |
828 | | - | |
829 | | - | |
830 | | - | |
831 | | - | |
| 830 | + | |
832 | 831 | | |
833 | 832 | | |
834 | 833 | | |
| |||
863 | 862 | | |
864 | 863 | | |
865 | 864 | | |
866 | | - | |
867 | | - | |
| 865 | + | |
868 | 866 | | |
869 | 867 | | |
870 | 868 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
0 commit comments