<table border="1" cellspacing="0" cellpadding="8">
    <tr>
        <th>Issue</th>
        <td>
            <a href=http://email.email.llvm.org/c/eJzNV9mOozgU_RryYhGBSUJ44KGWjtRSa0aqKmnmLTLmBjwNdmSbqs58_VybLCRFeqmeh0iIxcvl3HOOt0KVu_ylBhIsok3DZIVPstFKWpAlKRUYGdDUEt5pDdI2OwJyozQHYlQLRG2Ixc5mJy37Rhh24Uoaq5mQ1hBjmYWSCOkbrZTGCkloFC9dlSyZ9pUaGmaFwlbKwcBgPGRNExrbWvyekpdaGIKXqdWbdD0YCeb3BlomreCGWDCWICpy3nX-GNBlbe3WBMldQFd4VcLWXTHlqsWPpnk9PMKtVv8At_hZNKrAR4sp4KPnhK7cL_DxfPgnvruf1ciU-Nejj-LpJosCmpG3WvCadAaMz_vv1d3nL6QUGuOLV0ccFjPr6zzyLTOurWPv09PTn0-ntoa8IWDHSwGkBAu6FRIZBa0x2xaMYZVrVIOGvtCT1DUlURwlC-gDKTqLOhKpBiJOyV81yFF0DgUyeFD2Y4AYwtHQqlcoHYSLTF0R67mRqPrRCmgdFBEDVr1zWnAmcrE8eNZVtZ0G0WMQ3fX353HbYcwRG50zcLBx6azhg4W9Kq4n_jx8ZVqwogHXs-0Qe-G4QfNZqED3XQgJnRG_0DSk2e_ZLeMQZVGWFQWbFbBYlpTRRVZExaakRVxyvkg3ES1nH7JkggidMUOXnZCvrBHl2u62PjkcV4wcsvWyY4Vr2KhKcNbg2yBb_OivfREhAY3J85Cxnq4TV8RgFKbPenhbIU3k5f7xVOHgO_Mhj06DIHk8A4scH5teIvkZ9S6B9OIlcZgkNy1eEh_Fw_Gy3mexl-5EM9Oa7YbJvdfqA2JdV2tErgG8M7Guq4UTR2uqK3rx-p1asyycRzet1iz7P4YaBhgV8Ht6nCnSE_vdITQiC74-xHFKHdq9SFIRswUuNsK5o3ZrA9tugeF0r3BqxjYSZ1zcEPh1ucJF4jT9-rHYCGPPkuiVXNBwsbxpJRf0jK_xEdWPqT8-QNIFQ9c0vlxrrwm-H4KuZO3eO7_OHkq7LehN06nO-MpjYreYydG6flex3u8qXDbHmmE--8IfTDh7ZycDZ7PR5QL3MePzUr_vHDjbFfYMua1FP2MpIUv4hjsiVTivTi-mr5SG6W2bPj0z_cDz5IxedMpDDfzrYONFPL_u8NBe3-9fBPkpb7w3OVfrPc_rw4Zsfh97Xg_YbwHt0a4DvG5NY9yOIB7z7aTMkzJLMjZhna2Vzr8iSDPpdJP_sn-EMZ3bfK_mSRbPJ3UepTCDKIGkmBXlIk14nKVxMkMDLZfzCJs0rIDG5Ig0oFTCG_Eh8B1xT34fgchpRPGKl1GEBekUyoTTBeWbmGUsm8-DWYSWFc3UxZkqXU107kMWXWWw0s025lSJhwtRSQAPGBFaYRvIn905dX9AxSX3Fw4LhyMCKXajx-OJzyf3yfwHD1HB1w>53915</a>
        </td>
    </tr>

    <tr>
        <th>Summary</th>
        <td>
            Some syntax of and constraints on `sync-all-stmt` not enforced by `flang` frontend
        </td>
    </tr>

    <tr>
      <th>Labels</th>
      <td>
            new issue
      </td>
    </tr>

    <tr>
      <th>Assignees</th>
      <td>
      </td>
    </tr>

    <tr>
      <th>Reporter</th>
      <td>
          ktras
      </td>
    </tr>
</table>

<pre>
    The `flang` frontend doesn't currently enforce some of the syntax and constraints stated in the Fortran 2018 standard in relation to `sync-all-stmt`. This is shown in a [semantics test for sync-all-stmt](https://github.com/llvm/llvm-project/blob/main/flang/test/Semantics/synchronization01.f90) which uses the XFAIL directive so that the test passes and ERROR directives with to be determined error messages where errors should occur, but do not currently. When the XFAIL directive and all of the ERROR directives with to be determined error messages are removed, the test passes, as the non standard conforming statements are not caught.

Syntax and constraints on `sync-all-stmt` not currently enforced:
- that `stat-variable` must be an integer
  - [L27-29](https://github.com/llvm/llvm-project/blob/9ce09099bba4be68d2a269b0bfd2b1dcc67f02d4/flang/test/Semantics/synchronization01.f90#L27) - `invalid_type` is a variable of type `logical`
  - ```
    ! Stat-variable must an integer scalar
    !ERROR: TBD
    sync all(stat=invalid_type)
     ```
- that `stat-variable` must be a scalar
   - [L31-33](https://github.com/llvm/llvm-project/blob/9ce09099bba4be68d2a269b0bfd2b1dcc67f02d4/flang/test/Semantics/synchronization01.f90#L31) - `non_scalar` is an integer array
   - ```
     ! Stat-variable must an integer scalar
     !ERROR: TBD
     sync all(stat=non_scalar)
      ```
- that `errmsg-variable` must be a char
   - [L49-50](https://github.com/llvm/llvm-project/blob/9ce09099bba4be68d2a269b0bfd2b1dcc67f02d4/flang/test/Semantics/synchronization01.f90#L49) - `invalid_type` is a variable of type `logical`
   -  ```
       !ERROR: TBD
       sync all(errmsg=invalid_type)
       ```
- `C1172` - that no specifier shall appear more than once in a given `sync-stat-list`
    - [L62-68](https://github.com/llvm/llvm-project/blob/9ce09099bba4be68d2a269b0bfd2b1dcc67f02d4/flang/test/Semantics/synchronization01.f90#L62)
    - ```
       ! No specifier shall appear more than once in a given sync-stat-list
       !ERROR: to be determined
       sync all(stat=sync_status, stat=superfluous_stat)

       ! No specifier shall appear more than once in a given sync-stat-list
       !ERROR: to be determined
       sync all(errmsg=error_message, errmsg=superfluous_errmsg)
      ```
- `C1173` - that a `stat-variable` or `errmsg-variable` in a `sync-stat` shall not be a coindexed object.
   - [L72-78](https://github.com/llvm/llvm-project/blob/9ce09099bba4be68d2a269b0bfd2b1dcc67f02d4/flang/test/Semantics/synchronization01.f90#L72)
   - ``` 
      ! Check constraint C1173 from the Fortran 2018 standard
      !ERROR: to be determined
      sync all(stat=co_indexed_integer[1])
 
      ! Check constraint C1173 from the Fortran 2018 standard
      !ERROR: to be determined
      sync all(errmsg=co_indexed_character[1])
      ```

</pre>
<img width="1px" height="1px" alt="" src="http://email.email.llvm.org/o/eJzNV12PozYU_TXkxSICk5DwkIf56EiVVq00M1L7Fhn7Au6CHdlmZtNf32uT7yHb3WkfIkUB_HE595xj-1JqsV29NkCiPKlapmq8kspo5UAJIjRYFdGFI7w3BpRrtwRUpQ0HYnUHRFfE4WS7VY59IwyncK2sM0wqZ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