This is an archive of the discontinued LLVM Phabricator instance.

[clang-format] fix crash in NamespaceEndCommentsFixer (PR32438)
ClosedPublic

Authored by mgehre on Mar 28 2017, 2:13 PM.

Diff Detail

Repository
rL LLVM

Event Timeline

mgehre created this revision.Mar 28 2017, 2:13 PM
djasper edited reviewers, added: krasimir; removed: djasper.Mar 28 2017, 2:42 PM
djasper added a subscriber: djasper.
krasimir edited edge metadata.Mar 28 2017, 3:06 PM

Looks good! I just have two nits.

lib/Format/NamespaceEndCommentsFixer.cpp
139 ↗(On Diff #93298)

I'd instead just add a guard check at old line 136:

if (!NamespaceTok || NamespaceTok->isNot(tok::kw_namespace))
  continue;
unittests/Format/NamespaceEndCommentsFixerTest.cpp
586 ↗(On Diff #93298)

I'd make the test name a bit descriptive; something like:
HandlesInlineAtEndOfLine_PR32438

mgehre updated this revision to Diff 93507.Mar 30 2017, 11:10 AM

Updated for comments

krasimir accepted this revision.Apr 4 2017, 3:01 AM

Great!

This revision is now accepted and ready to land.Apr 4 2017, 3:01 AM
This revision was automatically updated to reflect the committed changes.