https://gcc.gnu.org/bugzilla/show_bug.cgi?id=111900

            Bug ID: 111900
           Summary: newlines in arguments in function-like macros are not
                    preserved
           Product: gcc
           Version: unknown
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: preprocessor
          Assignee: unassigned at gcc dot gnu.org
          Reporter: ben at wibking dot com
  Target Milestone: ---

The documentation for the cpp preprocessor states:

"The invocation of a function-like macro can extend over many logical lines.
However, in the present implementation, the entire expansion comes out on one
line. Thus line numbers emitted by the compiler or debugger refer to the line
the invocation started on, which might be different to the line containing the
argument causing the problem.

"We consider this a bug, and intend to fix it in the near future."

There does not appear to be a tracking bug in the Bugzilla for this.

This is an important feature to have in order to be able to debug code compiled
with single-pass host/device compilers when using function-like macros that
specialize for host or device code, e.g., NV_IF_TARGET
(https://github.com/NVIDIA/cccl/blob/61c1fd043ac0942805bab97429fdf72242182314/libcudacxx/examples/nv_target.cu#L14).

Reply via email to