Index: clang/lib/Format/TokenAnnotator.cpp =================================================================== --- clang/lib/Format/TokenAnnotator.cpp +++ clang/lib/Format/TokenAnnotator.cpp @@ -3881,6 +3881,8 @@ return true; if (Style.isCpp()) { + if (Right.is(tok::period) && Left.is(tok::numeric_constant)) + return true; // Space between import . // or import .....; if (Left.is(Keywords.kw_import) && Right.isOneOf(tok::less, tok::ellipsis)) Index: clang/unittests/Format/FormatTest.cpp =================================================================== --- clang/unittests/Format/FormatTest.cpp +++ clang/unittests/Format/FormatTest.cpp @@ -25312,6 +25312,11 @@ verifyFormat("int i;\n", "int i;", Style); } +TEST_F(FormatTest, SpaceAfterUDL) { + verifyFormat("auto c = (4s).count();"); + verifyFormat("auto x = 5s .count() == 5;"); +} + } // namespace } // namespace format } // namespace clang