[PATCH] D125771: [clang-tidy] Add a useful note about -std=c++11-or-later
Whisperity via Phabricator via cfe-commits
cfe-commits at lists.llvm.org
Wed May 18 02:13:47 PDT 2022
whisperity added a comment.
In D125771#3519606 <https://reviews.llvm.org/D125771#3519606>, @LegalizeAdulthood wrote:
> I thought there wasn't any support for validating fixits applied to header files?
It is not specifically about the fixits, but diagnostics as a whole. It was not clear that if you say `-std=c++11-or-later` it will actually run **multiple** executions without giving you the ability to observe the contents of the files.
Technically, you can always match a diagnostic that is positioned into a header from the TU that is producing that diagnostic, because `// CHECK-MESSAGES:` does a regular expression-like matching. For example, `misc-unused-parameters` does the following <http://github.com/llvm/llvm-project/blob/dd12c3433ee9b4ef15c633bd325ab5a0c9c5e03b/clang-tools-extra/test/clang-tidy/checkers/misc-unused-parameters.cpp>:
#include "header.h"
// CHECK-MESSAGES: header.h:1:38: warning
And because LIT can execute arbitrary commands, you can always go about your way running `FileCheck` and everything else manually.
But it is good to be reminded early on that `-or-later` will result in execution of potentially changed code outside of your (test file's) control. Saves the debugging time which we had to endure!
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D125771/new/
https://reviews.llvm.org/D125771
More information about the cfe-commits
mailing list