Index: clang/include/clang/Basic/DiagnosticFrontendKinds.td =================================================================== --- clang/include/clang/Basic/DiagnosticFrontendKinds.td +++ clang/include/clang/Basic/DiagnosticFrontendKinds.td @@ -175,7 +175,7 @@ "%select{expected|'expected-no-diagnostics'}0 directive cannot follow " "%select{'expected-no-diagnostics' directive|other expected directives}0">; def err_verify_no_directives : Error< - "no expected directives found: consider use of 'expected-no-diagnostics'">; + "no expected directives found: consider use of '%0-no-diagnostics'">; def err_verify_nonconst_addrspace : Error< "qualifier 'const' is needed for variables in address space '%0'">; Index: clang/lib/Frontend/VerifyDiagnosticConsumer.cpp =================================================================== --- clang/lib/Frontend/VerifyDiagnosticConsumer.cpp +++ clang/lib/Frontend/VerifyDiagnosticConsumer.cpp @@ -1095,7 +1095,8 @@ // 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(); + const auto &Prefixes = Diags.getDiagnosticOptions().VerifyPrefixes; + Diags.Report(diag::err_verify_no_directives).setForceEmit() << *Prefixes.begin(); ++NumErrors; Status = HasNoDirectivesReported; }