aboutsummaryrefslogtreecommitdiff
path: root/gcc/testsuite/gfortran.dg/alloc_comp_std.f90
diff options
context:
space:
mode:
Diffstat (limited to 'gcc/testsuite/gfortran.dg/alloc_comp_std.f90')
-rw-r--r--gcc/testsuite/gfortran.dg/alloc_comp_std.f9014
1 files changed, 14 insertions, 0 deletions
diff --git a/gcc/testsuite/gfortran.dg/alloc_comp_std.f90 b/gcc/testsuite/gfortran.dg/alloc_comp_std.f90
new file mode 100644
index 0000000..2ca7f0a
--- /dev/null
+++ b/gcc/testsuite/gfortran.dg/alloc_comp_std.f90
@@ -0,0 +1,14 @@
+! { dg-do compile }
+! { dg-options "-std=f95" }
+!
+! Check that we don't accept allocatable components for -std=f95 (PR 20541)
+!
+program main
+
+ type :: foo
+ integer, allocatable :: bar(:) ! { dg-error "ALLOCATABLE attribute" }
+
+ integer :: x ! Just to avoid "extra" error messages about empty type.
+ end type foo
+
+end program main