[clang-tidy] Add a useful note about -std=c++11-or-later
I and @whisperity spent some time debugging a LIT test case using the `-std=c++11-or-later` `check_clang_tidy.py` flag when the test had fixits. It turns out if the test wants to report a diagnostic into a header file AND into the test file as well, one needs to first copy the header somewhere under the build directory. It needs to be copied since `clang-tidy` sorts the reports into alphabetical order, thus to have a deterministic order relative to the diagnostic in the header AND the diagnostic in the test cpp file. There is more to this story. The `-std=c++11-or-later` turns out executes the test with multiple `-std=XX` version substitution, and each execution will also have the `-fix` tidy parameter. This means that the freshly copied header file I stated in the previous paragraph gets fixed up and the very next tidy execution will fail miserably. Following @whisperity's advice, I'm leaving a reminder about such //shared// state in the related doc comment. Reviewed By: LegalizeAdulthood Differential Revision: https://reviews.llvm.org/D125771
Loading
Please sign in to comment