diff --git a/lib/Parse/Lexer.cpp b/lib/Parse/Lexer.cpp index d9f3c70ffddc9..f6806cf151c13 100644 --- a/lib/Parse/Lexer.cpp +++ b/lib/Parse/Lexer.cpp @@ -452,6 +452,8 @@ static bool skipToEndOfSlashStarComment(const char *&CurPtr, case '/': // Check for a '/*' if (*CurPtr == '*') { + if (CurPtr[1] == '/') + continue; ++CurPtr; ++Depth; } diff --git a/test/Parse/slash_star_comment.swift b/test/Parse/slash_star_comment.swift new file mode 100644 index 0000000000000..bd10a2c20cd10 --- /dev/null +++ b/test/Parse/slash_star_comment.swift @@ -0,0 +1,10 @@ +// RUN: %target-typecheck-verify-swift + +// https://github.com/swiftlang/swift/issues/44163 + +/* +//*/ +print("wat") + +/*/ comment /*/ +print("ok")