Skip to content

[Flang] Error during macro expension of mathematical expression at compile time. #168077

@JDPailleux

Description

@JDPailleux

Hello,
I encountered a problem in the Ramses project that used the macro as follows:

program test
#if NVAR > 2
print *, "YES"
#else
print *, "NO"
#endif
end program
When I compile with gfortran with -cpp -DNVAR=2+1+0+0, it doesn't raise an error and the mathematical expression was expand and evaluated correctly.
However, with Flang, this was not the case and the macro was expanded as a string, which is not valid normally.

Issue also referenced in PR #166785

Metadata

Metadata

Assignees

Type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions