Skip to content

simplecpp does not handle hashes in __VA_OPT__ correctly #458

Open
@glankk

Description

@glankk

Test code:

#define A(x, ...) # __VA_OPT__(# x)
A(x, y)

#define B(x, ...) # __VA_OPT__(x ## __VA_ARGS__)
B(Hello, world)

simplecpp output:

#
"x"


"Hello" world

gcc output:

# 0 "<stdin>"
# 0 "<built-in>"
# 0 "<command-line>"
# 1 "/usr/include/stdc-predef.h" 1 3 4
# 0 "<command-line>" 2
# 1 "<stdin>"

"\"x\""


"Helloworld"

clang output:

# 1 "<stdin>"
# 1 "<built-in>" 1
# 1 "<built-in>" 3
# 411 "<built-in>" 3
# 1 "<command line>" 1
# 1 "<built-in>" 2
# 1 "<stdin>" 2

"\"x\""


"Helloworld"

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions