OSDN Git Service

PR testsuite/51875
[pf3gnuchains/gcc-fork.git] / gcc / testsuite / gfortran.dg / class_36.f03
1 ! { dg-do compile }
2 !
3 ! PR 47572: [OOP] Invalid: Allocatable polymorphic with init expression.
4 !
5 ! Contributed by Edmondo Giovannozzi <edmondo.giovannozzi@gmail.com>
6 ! cf. http://groups.google.com/group/comp.lang.fortran/browse_thread/thread/763785b16883ed68
7
8 program scalar_allocation
9   type test
10     real :: a
11   end type
12   class (test), allocatable :: b = test(3.4)  ! { dg-error "cannot have an initializer" }
13   print *,allocated(b)
14 end program