<table border="1" cellspacing="0" cellpadding="8">
    <tr>
        <th>Issue</th>
        <td>
            <a href=https://github.com/llvm/llvm-project/issues/59233>59233</a>
        </td>
    </tr>

    <tr>
        <th>Summary</th>
        <td>
            [Flang] Compiler version and Compiler Options should be allowed in constant expressions
        </td>
    </tr>

    <tr>
      <th>Labels</th>
      <td>
            flang:frontend
      </td>
    </tr>

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

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

<pre>
    The transformational functions Compiler version and Compiler Options from ISO_FORTRAN_ENV intrinsic module are currently not allowed in constant expressions.

In the standard these are categorised as specification inquiries. Specification inquiries (without bad arguments or returns) are categorised as constant expressions.

Reproducer
```
module m
  use iso_fortran_env, only: compiler_options, compiler_version
  character(*), parameter :: cv = compiler_version()
  character(*), parameter :: co = compiler_options()
end module
```

Error
```
error: Semantic errors in mod.f90
./mod.f90:3:35: error: Must be a constant value
    character(*), parameter :: cv = compiler_version()
                                    ^^^^^^^^^^^^^^^^^^
./mod.f90:4:35: error: Must be a constant value
    character(*), parameter :: co = compiler_options()
                                    ^^^^^^^^^^^^^^^^^^
```

                                    
</pre>
<img width="1px" height="1px" alt="" src="http://email.email.llvm.org/o/eJy1VN9vmzAQ_mvgxRoCU2h44CFrG6kPa6V22mtk7IN4Mzbzj3T973eGpNG0aO2mNXIAn4_v7vvuuM6I5_bzDoi3TLve2JF5aTRTpA-ax0dHrsw4SQWW7ME6tBCmxcl4Py1evTUjuX28327uHz4_rO-2N3dfiNTeSu0kJ6MRQQFhFggP1oL26plo4wlTyjyBQFfCEccz7Qn8mCy4GMtlSX6d5OvlequJx1yjk2BWxI07YDIPg7HSIRJzxE3AZS_5TAahvwdpJbiMPJ4_IAldPUm_M8GTjiGEHcKIOTpiLLHgg9Uuoc25UK8m_QCTRfIc7MFa54c1bw_CjMuOkICMpDNbrEWsyRb0PqFXxGj1nJRrDLfovjWL7vHsxXYo0BGK75hl3GNgukroGglE7wmNI6CVIN4Mucen699R4kvN32KZX7FesjxhAXbPQvqsHsv1xlpzXi-YTzDUI4woO7bWbHGxgRA265uDY5bQzdFQrsv4r-J7LwCfgsNqY_-carhnKsCR8v8V8PVfUt38yzpD9uI9yb5e4fcme7Zj3hI0hbao66a-oJdlk4q2FE3ZsNRLr6BNqo8bxfSQVNdvHHkO54USs6p_HmJpsKrdeT-5KCLd4Bpw2oQuQxlxo9T-ePuAw-IrcI9b6VwAFHZTNbQs010rmKhFcUm7kpc5bSAvclE3TZ83heBd3qWKdaBcZJJQ2s9kyjUOZu3xo0MTUktlS3NKi4KuirJcVU3GeN2Jjl_youuqVV4mFzl-WVJlMZ3M2CG17ZxZFwaHh0o6706HDCkOGmb9Ij4LOEZt-03i8MKW0gL7x-A9nem0M5efPIj2CA">