Skip to content

[LOW] Support C++14 integer literal digit separators #83

@jefftrull

Description

@jefftrull

Filing this chiefly for the record. cppreference states that since C++14:

Optional single quotes(') may be inserted between the digits as a separator. They are ignored by the compiler.

I verified this is true in gcc. At this time Wave does not understand them. For example:

#include <iostream>

// can insert single quotes between digits starting in C++14:
int foo = 1'2'3;   // wave thinks this is two ints and one char literal
int bar = 0x2'3;   // wave thinks this is two ints and a single quote

int main() {
    std::cout << foo << "\n";   // 123
    std::cout << bar << "\n";   // 35

    return 0;
}

I don't need this functionality but wanted to record it for some future maintainer.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions