Skip to content

[clang-scan-deps] Error if integer literal contains a single quote in #if directive #88896

Open
@Sirraide

Description

@Sirraide

On main, running clang-scan-deps -format=p1689 -- clang++ -std=c++20 test.cc on this program

// File: test.cc
#if 123'124
#endif

gives:

Error while scanning dependencies for test.cc:
test.cc:1:8: error: token is not a valid binary operator in a preprocessor subexpression

The diagnostic seems to be err_pp_expr_bad_token_binop. Removing the single quote fixes this, but from what I can tell, this is in fact a valid pp-number preprocessing token (see [lex.ppnumber]), so I think this is just straight-up a bug.

Metadata

Metadata

Assignees

No one assigned

    Labels

    clang:frontendLanguage frontend issues, e.g. anything involving "Sema"clang:toolingLibTooling

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions