diff options
author | Owen Pan <owenpiano@gmail.com> | 2025-01-30 18:03:04 -0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2025-01-30 18:03:04 -0800 |
commit | 14178deab0334d9ce095ae7adce408868659faee (patch) | |
tree | 9ffd1a2289b3034b85ab6743d2b4a85149ed08fc /clang/lib/Format/UnwrappedLineParser.cpp | |
parent | 4fb80788872e1c1c789fc9a06edd123414a427e6 (diff) | |
download | llvm-14178deab0334d9ce095ae7adce408868659faee.zip llvm-14178deab0334d9ce095ae7adce408868659faee.tar.gz llvm-14178deab0334d9ce095ae7adce408868659faee.tar.bz2 |
[clang-format] Fix a crash on parsing requires clause (#125021)
Fixes #124921.
Diffstat (limited to 'clang/lib/Format/UnwrappedLineParser.cpp')
-rw-r--r-- | clang/lib/Format/UnwrappedLineParser.cpp | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/clang/lib/Format/UnwrappedLineParser.cpp b/clang/lib/Format/UnwrappedLineParser.cpp index 906fc11..120922d 100644 --- a/clang/lib/Format/UnwrappedLineParser.cpp +++ b/clang/lib/Format/UnwrappedLineParser.cpp @@ -3632,7 +3632,7 @@ void UnwrappedLineParser::parseRequiresClause(FormatToken *RequiresToken) { // It could be inlined into here. parseConstraintExpression(); - if (!InRequiresExpression) + if (!InRequiresExpression && FormatTok->Previous) FormatTok->Previous->ClosesRequiresClause = true; } |