fortls icon indicating copy to clipboard operation
fortls copied to clipboard

Preprocessor variable declared twice

Open gnikit opened this issue 3 years ago • 0 comments

Describe the bug The variable real_t should not throw a diagnostic error

To Reproduce

module mwe
  use iso_c_binding, only: c_int32_t, c_int64_t, c_double, c_float

#define REALTYPEWIDTH 32
#if REALTYPEWIDTH == 32
  integer, parameter, public :: real_t = c_float
#elif REALTYPEWIDTH == 64
  integer, parameter, public :: real_t = c_double
#else
  #error "Incorrect user-supplied value for REALTYPEWIDTH"
#endif
  implicit none
  private

end module mwe

Expected behavior No diagnostic errors

gnikit avatar Jul 04 '22 23:07 gnikit