[clang] [llvm] [clang] Add `-verify-directives` cc1 flag (PR #179835)

Aaron Ballman via cfe-commits cfe-commits at lists.llvm.org
Tue Feb 17 06:55:24 PST 2026


================
@@ -3476,6 +3492,53 @@ diagnostic verifier will pass. However, if the expected error does not appear
 or appears in a different location than expected, or if additional diagnostics
 appear, the diagnostic verifier will fail and emit information as to why.
 
+Directive Syntax
+~~~~~~~~~~~~~~~~
+EBNF syntax description of the directives is the following:
+
+.. productionlist:: verify-grammar
+  directive: prefix , "-" , diagnostic-kind , [ regex-match ] , [ diagnotic-loc ] , [ " " , quantifier ] , "{" , [ delimiter-open ], "{", [ diagnostic-text ] , "}" , [ delimiter-close ], "}" ;
----------------
AaronBallman wrote:

It might make sense to produce this with C++ grammar instead of EBNF; I got hung up on the delimiter open and close syntax here (not super familiar with EBNF) and couldn't tell what it was trying to tell me.

https://github.com/llvm/llvm-project/pull/179835


More information about the cfe-commits mailing list