Skip to content

Incorrect spacing in macro stringizing #133965

@kyuupichan

Description

@kyuupichan
#define str(x) #x
#define xstr(x) str(x)
#define f(x) x :
xstr(+f())

With the empty argument to f, the space before the colon somehow gets eaten.
I believe this should expand to "+ :" with a space before the colon which is what GCC does.

Metadata

Metadata

Assignees

No one assigned

    Labels

    clang:frontendLanguage frontend issues, e.g. anything involving "Sema"diverges-from:gccDoes the clang frontend diverge from gcc on this issuediverges-from:msvcDoes the clang frontend diverge from msvc on this issue

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions