diff options
author | tobi <tobi@138bc75d-0d04-0410-961f-82ee72b054a4> | 2007-03-22 15:37:25 +0000 |
---|---|---|
committer | tobi <tobi@138bc75d-0d04-0410-961f-82ee72b054a4> | 2007-03-22 15:37:25 +0000 |
commit | bca4d139fd7eb1b554c6701071c27048a0e458a6 (patch) | |
tree | 882cdd13c2d34e1457116a52cec83aa37b6143f0 /gcc/testsuite/gfortran.dg | |
parent | a745c94ee058dbd776d5c9a9dfe0b2f0fef3b966 (diff) | |
download | gcc-bca4d139fd7eb1b554c6701071c27048a0e458a6.tar.gz |
PR fortran/20897
fortran/
* decl.c (gfc_match_derived_decl): Reliably reject
'doubleprecision' and 'doublecomplex' as type names.
testsuite/
* gfortran.dg/derived_name_1.f90: New.
* gfortran.dg/derived_name_2.f: New.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@123129 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/testsuite/gfortran.dg')
-rw-r--r-- | gcc/testsuite/gfortran.dg/derived_name_1.f90 | 19 | ||||
-rw-r--r-- | gcc/testsuite/gfortran.dg/derived_name_2.f | 19 |
2 files changed, 38 insertions, 0 deletions
diff --git a/gcc/testsuite/gfortran.dg/derived_name_1.f90 b/gcc/testsuite/gfortran.dg/derived_name_1.f90 new file mode 100644 index 00000000000..9c6b1775d11 --- /dev/null +++ b/gcc/testsuite/gfortran.dg/derived_name_1.f90 @@ -0,0 +1,19 @@ +! { dg-do compile } +! PR 20897 +! Make sure intrinsic type names do not appear as names of derived types +type integer ! { dg-error "cannot be the same as an intrinsic type" } +type real ! { dg-error "cannot be the same as an intrinsic type" } +type complex ! { dg-error "cannot be the same as an intrinsic type" } +type character ! { dg-error "cannot be the same as an intrinsic type" } +type logical ! { dg-error "cannot be the same as an intrinsic type" } +type complex ! { dg-error "cannot be the same as an intrinsic type" } +type double precision ! { dg-error "Unclassifiable statement" } +type doubleprecision ! { dg-error "cannot be the same as an intrinsic type" } +type double complex ! { dg-error "Unclassifiable statement" } +type doublecomplex ! { dg-error "cannot be the same as an intrinsic type" } + +type x + integer y +end type x +end + diff --git a/gcc/testsuite/gfortran.dg/derived_name_2.f b/gcc/testsuite/gfortran.dg/derived_name_2.f new file mode 100644 index 00000000000..a89dcdfbd71 --- /dev/null +++ b/gcc/testsuite/gfortran.dg/derived_name_2.f @@ -0,0 +1,19 @@ +! { dg-do compile } +! PR 20897 +! Make sure intrinsic type names do not appear as names of derived types + type integer ! { dg-error "cannot be the same as an intrinsic type" } + type real ! { dg-error "cannot be the same as an intrinsic type" } + type complex ! { dg-error "cannot be the same as an intrinsic type" } + type character ! { dg-error "cannot be the same as an intrinsic type" } + type logical ! { dg-error "cannot be the same as an intrinsic type" } + type complex ! { dg-error "cannot be the same as an intrinsic type" } + type double precision ! { dg-error "cannot be the same as an intrinsic type" } + type doubleprecision ! { dg-error "cannot be the same as an intrinsic type" } + type double complex ! { dg-error "cannot be the same as an intrinsic type" } + type doublecomplex ! { dg-error "cannot be the same as an intrinsic type" } + + type x + integer y + end type x + end + |