Index: clang/lib/Format/IntegerLiteralSeparatorFixer.cpp =================================================================== --- clang/lib/Format/IntegerLiteralSeparatorFixer.cpp +++ clang/lib/Format/IntegerLiteralSeparatorFixer.cpp @@ -113,7 +113,9 @@ continue; } if (Style.isCpp()) { - if (const auto Pos = Text.find_first_of("_i"); Pos != StringRef::npos) { + // FIXME: This doesn't work for ud-suffix d from std::chrono::day. + if (const auto Pos = Text.find_first_of("_himnsuy"); + Pos != StringRef::npos) { Text = Text.substr(0, Pos); Length = Pos; } Index: clang/unittests/Format/IntegerLiteralSeparatorTest.cpp =================================================================== --- clang/unittests/Format/IntegerLiteralSeparatorTest.cpp +++ clang/unittests/Format/IntegerLiteralSeparatorTest.cpp @@ -60,6 +60,20 @@ "hil = 0xABCil;", Style); + verifyFormat("bh = 0b1'0000h;\n" + "dmin = 1'234min;\n" + "dns = 1'234ns;\n" + "ds = 1'234s;\n" + "dus = 1'234us;\n" + "hy = 0xA'BCy;", + "bh = 0b10000h;\n" + "dmin = 1234min;\n" + "dns = 1234ns;\n" + "ds = 1234s;\n" + "dus = 1234us;\n" + "hy = 0xABCy;", + Style); + verifyFormat("d = 5'678_km;\n" "h = 0xD'EF_u16;", "d = 5678_km;\n"