This revision was automatically updated to reflect the committed changes. Closed by commit rG14198ccfb383: [clang-format] Fix lambda with ellipsis in return type (authored by MyDeveloperDay).
Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D78694/new/ https://reviews.llvm.org/D78694 Files: clang/lib/Format/UnwrappedLineParser.cpp clang/unittests/Format/FormatTest.cpp Index: clang/unittests/Format/FormatTest.cpp =================================================================== --- clang/unittests/Format/FormatTest.cpp +++ clang/unittests/Format/FormatTest.cpp @@ -14125,6 +14125,8 @@ " -> int {\n" " return 1; //\n" "};"); + verifyFormat("[]() -> Void<T...> {};"); + verifyFormat("[a, b]() -> Tuple<T...> { return {}; };"); // Lambdas with explicit template argument lists. verifyFormat( Index: clang/lib/Format/UnwrappedLineParser.cpp =================================================================== --- clang/lib/Format/UnwrappedLineParser.cpp +++ clang/lib/Format/UnwrappedLineParser.cpp @@ -1646,6 +1646,7 @@ case tok::lessequal: case tok::question: case tok::colon: + case tok::ellipsis: case tok::kw_true: case tok::kw_false: if (SeenArrow) {
Index: clang/unittests/Format/FormatTest.cpp =================================================================== --- clang/unittests/Format/FormatTest.cpp +++ clang/unittests/Format/FormatTest.cpp @@ -14125,6 +14125,8 @@ " -> int {\n" " return 1; //\n" "};"); + verifyFormat("[]() -> Void<T...> {};"); + verifyFormat("[a, b]() -> Tuple<T...> { return {}; };"); // Lambdas with explicit template argument lists. verifyFormat( Index: clang/lib/Format/UnwrappedLineParser.cpp =================================================================== --- clang/lib/Format/UnwrappedLineParser.cpp +++ clang/lib/Format/UnwrappedLineParser.cpp @@ -1646,6 +1646,7 @@ case tok::lessequal: case tok::question: case tok::colon: + case tok::ellipsis: case tok::kw_true: case tok::kw_false: if (SeenArrow) {
_______________________________________________ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits