Files
llvm-project/flang/test/Semantics/expr-errors05.f90
Andre Kuhlenschmidt 83b462af17 [flang][CLI] Have the CLI hint the flag to disable a warning (#144767)
Adds a hint to the warning message to disable a warning and updates the
tests to expect this.

Also fixes a bug in the storage of canonical spelling of error flags so
that they are not used after free.
2025-06-30 10:17:05 -07:00

17 lines
964 B
Fortran

! RUN: %python %S/test_errors.py %s %flang_fc1 -Werror -pedantic
!PORTABILITY: nonstandard usage: generalized COMPLEX constructor [-Wcomplex-constructor]
!PORTABILITY: Real part of complex constructor is not scalar [-Wcomplex-constructor]
complex, parameter :: z1(*) = ([1.,2.], 3.)
!PORTABILITY: nonstandard usage: generalized COMPLEX constructor [-Wcomplex-constructor]
!PORTABILITY: Imaginary part of complex constructor is not scalar [-Wcomplex-constructor]
complex, parameter :: z2(*) = (4., [5.,6.])
real, parameter :: aa(*) = [7.,8.]
!PORTABILITY: Real part of complex literal constant is not scalar [-Wcomplex-constructor]
complex, parameter :: z3(*) = (aa, 9.)
!PORTABILITY: Imaginary part of complex literal constant is not scalar [-Wcomplex-constructor]
complex, parameter :: z4(*) = (10., aa)
!We need a nonzero exit status to make test_errors.py look at messages :-(
!WARNING: division by zero [-Wfolding-exception]
real, parameter :: xxx = 1./0.
end