This is an archive of the discontinued LLVM Phabricator instance.

[Format] Add test demonstrating PR42722
Needs RevisionPublic

Authored by modocache on Jul 23 2019, 7:24 AM.

Details

Summary

https://bugs.llvm.org/show_bug.cgi?id=42722 describes what I believe to
be a bug in lambda formatting. If it is indeed a bug, I'd like to commit
this test that reliably reproduces it. I'll try in the coming days to
then fix the behavior and update this test to demonstrate the correct
behavior (but if anyone fixes it before I do, this test will help them
too, I think).

Event Timeline

modocache created this revision.Jul 23 2019, 7:24 AM
Herald added a project: Restricted Project. · View Herald TranscriptJul 23 2019, 7:24 AM

We don't normally commit a failing test alone, otherwise the build machines will be broken until it gets fixed.. just add this test with your fix.

MyDeveloperDay requested changes to this revision.Jul 24 2019, 8:40 AM
This revision now requires changes to proceed.Jul 24 2019, 8:40 AM
modocache marked an inline comment as done.Jul 26 2019, 7:41 AM

Sure thing! Just to be clear: this test doesn't fail, it passes. My intention was to commit this, then commit a patch that improved the indentation behavior, which would also include a change to the test that demonstrated the new behavior. But, as per your suggestion, I'll wait for the fix before committing this. Thanks!

clang/unittests/Format/FormatTest.cpp
5184

This is a passing test that demonstrates that the indentation of c++ and d++ here is wacky.

MyDeveloperDay added inline comments.Aug 10 2019, 6:42 AM
clang/unittests/Format/FormatTest.cpp
5184

in what way do you think its incorrect? change the test to show what it should be...I think its better to commit a fix and a test at the same time then its easier for the reviewer and others to understand what you are driving at.

modocache added inline comments.Aug 11 2019, 10:00 AM
clang/unittests/Format/FormatTest.cpp
5184

The linked bug report, https://bugs.llvm.org/show_bug.cgi?id=42722, describes what I think the indentation of these two lines should be. I apologize, I should have included the actual code snippet in the commit message here. I am curious if you think the indentation in that bug report is desirable, though, so please let me know!