diff options
| author | sam <sam@138bc75d-0d04-0410-961f-82ee72b054a4> | 2008-02-27 11:53:55 +0000 |
|---|---|---|
| committer | sam <sam@138bc75d-0d04-0410-961f-82ee72b054a4> | 2008-02-27 11:53:55 +0000 |
| commit | 87f9eef516a3c7de69746d5effa92ec486480d66 (patch) | |
| tree | fd8cfa265faaebdd5a596dcdf4f456955046296f | |
| parent | 6295ca724123bcba17754cde6db8280274894197 (diff) | |
| download | ppe42-gcc-87f9eef516a3c7de69746d5effa92ec486480d66.tar.gz ppe42-gcc-87f9eef516a3c7de69746d5effa92ec486480d66.zip | |
gcc/ada/
PR ada/34799
* sem_ch13.adb (Analyze_Record_Representation_Clause): Check
that underlying type is present.
gcc/testsuite/
PR ada/34799
* gnat.dg/specs/pr34799.ads: New test.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@132707 138bc75d-0d04-0410-961f-82ee72b054a4
| -rw-r--r-- | gcc/ada/ChangeLog | 6 | ||||
| -rw-r--r-- | gcc/ada/sem_ch13.adb | 6 | ||||
| -rw-r--r-- | gcc/testsuite/ChangeLog | 5 | ||||
| -rw-r--r-- | gcc/testsuite/gnat.dg/specs/pr34799.ads | 19 |
4 files changed, 35 insertions, 1 deletions
diff --git a/gcc/ada/ChangeLog b/gcc/ada/ChangeLog index 148d066b42b..f50959627f5 100644 --- a/gcc/ada/ChangeLog +++ b/gcc/ada/ChangeLog @@ -1,3 +1,9 @@ +2008-02-27 Samuel Tardieu <sam@rfc1149.net> + + PR ada/34799 + * sem_ch13.adb (Analyze_Record_Representation_Clause): Check + that underlying type is present. + 2008-02-26 Tom Tromey <tromey@redhat.com> * misc.c (internal_error_function): Remove test of diff --git a/gcc/ada/sem_ch13.adb b/gcc/ada/sem_ch13.adb index 33a55a825b3..2b58c12edcd 100644 --- a/gcc/ada/sem_ch13.adb +++ b/gcc/ada/sem_ch13.adb @@ -2747,7 +2747,10 @@ package body Sem_Ch13 is -- We are only interested in the case where there is at least one -- unrepped component, and at least half the components have rep -- clauses. We figure that if less than half have them, then the - -- partial rep clause is really intentional. + -- partial rep clause is really intentional. If the component + -- type has no underlying type set at this point (as for a generic + -- formal type), we don't know enough to give a warning on the + -- component. if Num_Unrepped_Components > 0 and then Num_Unrepped_Components < Num_Repped_Components @@ -2756,6 +2759,7 @@ package body Sem_Ch13 is while Present (Comp) loop if No (Component_Clause (Comp)) and then Comes_From_Source (Comp) + and then Present (Underlying_Type (Etype (Comp))) and then (Is_Scalar_Type (Underlying_Type (Etype (Comp))) or else Size_Known_At_Compile_Time (Underlying_Type (Etype (Comp)))) diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index 3435b5bfb42..f3285de6a6c 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,8 @@ +2008-02-27 Samuel Tardieu <sam@rfc1149.net> + + PR ada/34799 + * gnat.dg/specs/pr34799.ads: New test. + 2008-02-27 Richard Guenther <rguenther@suse.de> PR middle-end/34971 diff --git a/gcc/testsuite/gnat.dg/specs/pr34799.ads b/gcc/testsuite/gnat.dg/specs/pr34799.ads new file mode 100644 index 00000000000..7d06049d07f --- /dev/null +++ b/gcc/testsuite/gnat.dg/specs/pr34799.ads @@ -0,0 +1,19 @@ +-- { dg-do compile } +-- { dg-options "-gnatwa" } + +package PR34799 is + generic + type Custom_T is private; + package Handler is + type Storage_T is record + A : Boolean; + B : Boolean; + C : Custom_T; + end record; + + for Storage_T use record + A at 0 range 0..0; + B at 1 range 0..0; + end record; + end Handler; +end PR34799; |

