Issue 181783
Summary [flang] Missing dimension when using -fdebug-dump-parse-tree-no-sema
Labels flang
Assignees
Reporter davidpfister
    Consider the following derived types: 

```fortran
module test_basic_types
 use, intrinsic :: iso_fortran_env, only: rp => real64
    type :: simple_type5
        real(rp), allocatable :: a(:, :)
    end type
    
 type :: simple_type6
        real(rp), allocatable :: a(:)
    end type
end module
```
When running the command `flang-new -fc1 -fdebug-dump-parse-tree-no-sema simple_types.f90 > ast.txt`, I get the following: 
```txt 
| | DeclarationConstruct -> SpecificationConstruct -> DerivedTypeDef
| | | DerivedTypeStmt
| | | | Name = 'simple_type5'
| | | ComponentDefStmt -> DataComponentDefStmt
| | | | DeclarationTypeSpec -> IntrinsicTypeSpec -> Real
| | | | | KindSelector -> Scalar -> Integer -> Constant -> Expr -> Designator -> DataRef -> Name = 'rp'
| | | | ComponentAttrSpec -> Allocatable
| | | | ComponentOrFill -> ComponentDecl
| | | | | Name = 'a'
| | | | | ComponentArraySpec -> DeferredShapeSpecList -> int
| | | EndTypeStmt -> 
| | DeclarationConstruct -> SpecificationConstruct -> DerivedTypeDef
| | | DerivedTypeStmt
| | | | Name = 'simple_type6'
| | | ComponentDefStmt -> DataComponentDefStmt
| | | | DeclarationTypeSpec -> IntrinsicTypeSpec -> Real
| | | | | KindSelector -> Scalar -> Integer -> Constant -> Expr -> Designator -> DataRef -> Name = 'rp'
| | | | ComponentAttrSpec -> Allocatable
| | | | ComponentOrFill -> ComponentDecl
| | | | | Name = 'a'
| | | | | ComponentArraySpec -> DeferredShapeSpecList -> int
| | | EndTypeStmt -> 
```

`simple_type5` should have 2 dimensions. It looks like, the tree is missing a second line 
`| | | | | ComponentArraySpec -> DeferredShapeSpecList -> int`
_______________________________________________
llvm-bugs mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-bugs

Reply via email to