
During function-like macro expansion in a standard C/C++ preprocessor, the macro being expanded is disabled from recursive macro expansion. The implementation in this compiler's preprocessor, however, was too broad; the macro expansion needs to be disabled for the "rescanning" phase only, not for actual argument expansion. (Also corrects an obsolete comment elsewhere that was noticed during reduction of an original test case.)
15 lines
298 B
Fortran
15 lines
298 B
Fortran
! RUN: %flang -E %s | FileCheck %s
|
|
#define KWM a
|
|
#define FLM(x) b FLM2(x) KWM c
|
|
#define FLM2(x) d FLM(x) e
|
|
! CHECK: a
|
|
KWM
|
|
! CHECK: b d FLM(y) e a c
|
|
FLM(y)
|
|
! CHECK: b d FLM(a) e a c
|
|
FLM(KWM)
|
|
! CHECK: b d FLM(b d FLM(y) e a c) e a c
|
|
FLM(FLM(y))
|
|
! CHECK: b d FLM(b d FLM(a) e a c) e a c
|
|
FLM(FLM(KWM))
|