[llvm] [clang] [clang-tools-extra] [Clang] Fix : More Detailed "No expected directives found" (PR #78338)
Shourya Goel via cfe-commits
cfe-commits at lists.llvm.org
Wed Jan 24 04:31:53 PST 2024
================
@@ -1098,7 +1098,13 @@ void VerifyDiagnosticConsumer::CheckDiagnostics() {
// Produce an error if no expected-* directives could be found in the
// source file(s) processed.
if (Status == HasNoDirectives) {
- Diags.Report(diag::err_verify_no_directives).setForceEmit();
+ std::string directives;
+ if (Diags.getDiagnosticOptions().VerifyPrefixes.empty()) {
+ directives = "expected";
----------------
Sh0g0-1758 wrote:
yes, when there are no diagnostics passed in the verify, ie. when we pass ```-verify=``` only. In this case ```expected-no-directives``` should be the error output when no directives are present. and when we pass ```-verify=foo``` then ```foo-no-diagnostics``` should be the error when no foo directives are present. If I don't include this check, then with only ```-verify=``` it results in a segmentation fault.
https://github.com/llvm/llvm-project/pull/78338
More information about the cfe-commits
mailing list