aboutsummaryrefslogtreecommitdiffstats
path: root/gcc-4.9/gcc/testsuite/gfortran.dg/class_7.f03
diff options
context:
space:
mode:
Diffstat (limited to 'gcc-4.9/gcc/testsuite/gfortran.dg/class_7.f03')
-rw-r--r--gcc-4.9/gcc/testsuite/gfortran.dg/class_7.f0321
1 files changed, 21 insertions, 0 deletions
diff --git a/gcc-4.9/gcc/testsuite/gfortran.dg/class_7.f03 b/gcc-4.9/gcc/testsuite/gfortran.dg/class_7.f03
new file mode 100644
index 000000000..99fbf6fc6
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gfortran.dg/class_7.f03
@@ -0,0 +1,21 @@
+! { dg-do compile }
+! Test fixes for PR41587 and PR41608.
+!
+! Contributed by Tobias Burnus <burnus@gcc.gnu.org>
+!
+! PR41587: used to accept the declaration of component 'foo'
+ type t0
+ integer :: j = 42
+ end type t0
+ type t
+ integer :: i
+ class(t0), allocatable :: foo(3) ! { dg-error "deferred shape" }
+ end type t
+
+! PR41608: Would ICE on missing type decl
+ class(t1), pointer :: c ! { dg-error "before it is defined" }
+
+ select type (c) ! { dg-error "shall be polymorphic" }
+ type is (t0)
+ end select
+end