Issue 161989
Summary [flang] Default initialization failure
Labels flang:frontend
Assignees
Reporter DanielCChen
    Consider the following code:
```

   type Base
      integer :: i /-1/
   end type

   type, extends(Base) :: Child
      integer :: j /-3/
   end type

   type(Child) :: c1 = Child(1000)
   print*, c1%i
   print*, c1%j
end
```

Flang complains:
```
./t.f:10:24: error: Structure constructor lacks a value for component 'j'
     type(Child) :: c1 = Child(1000)
                         ^^^^^
./t.f:7:18: Declaration of 'j'
 integer :: j /-3/
                   ^
```

It works if I use `integer :: i = -1` instead. 
It also works if I use "empty" constructor as `type(child) :: c1`
_______________________________________________
llvm-bugs mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-bugs

Reply via email to