Fixing the clang-format crash with the segmentation fault error when formatting code with nested namespaces.
Fixes: #64701
Differential D158363
[clang-format] Fix segmentation fault when formatting nested namespaces d0nc1h0t on Aug 20 2023, 7:17 AM. Authored by
Details Fixing the clang-format crash with the segmentation fault error when formatting code with nested namespaces. Fixes: #64701
Diff Detail
Event TimelineComment Actions NOTE: Clang-Format Team Automated Review Comment
It looks like your clang-format review does not contain any unit tests, please try to ensure all code changes have a unit test (unless this is an NFC or refactoring, adding documentation etc..) Add your unit tests in clang/unittests/Format and you can build with ninja FormatTests. We recommend using the verifyFormat(xxx) format of unit tests rather than EXPECT_EQ as this will ensure you change is tolerant to random whitespace changes (see FormatTest.cpp as an example) For situations where your change is altering the TokenAnnotator.cpp which can happen if you are trying to improve the annotation phase to ensure we are correctly identifying the type of a token, please add a token annotator test in TokenAnnotatorTest.cpp Comment Actions Please upload the patch with the full context. And add a test case. (From your issue.) Comment Actions I'm creating a patch via 'git diff' from the root of the project. What does full context mean? Comment Actions If you look at your diff here there is Context not available.. Please use git diff -U99999. Comment Actions Do you need us to commit it for you? See https://llvm.org/docs/Phabricator.html#committing-someone-s-change-from-phabricator. Comment Actions 'git push' or 'arc land' give an error 'remote: Permission to llvm/llvm-project.git denied to d0nc1h0t'. git clone https://github.com/llvm/llvm-project.git/ . arc patch D158363 arc land with the same error. Maybe there are not enough rights to the project on GitHub? |
See below.