[clang] Add 'enum_select' diagnostic selection to clang. (PR #122505)

Aaron Ballman via cfe-commits cfe-commits at lists.llvm.org
Wed Jan 15 12:14:27 PST 2025


================
@@ -276,6 +276,21 @@ Description:
   diagnostic instead of having to do things textually.  The selected string
   does undergo formatting.
 
+**"enum_select format**
+
+Example:
+  ``unknown frobbling of a %enum_select<FrobbleKind>{%VarDecl{variable declaration}|%FuncDecl{function declaration}}0 when blarging``
+Class:
+  Integers
+Description:
+  This format specifier is used exactly like a ``select`` specifier, except it
+  additionally generates a namespace, enumeration, and enumerator list based on
+  the format string given. In the above case, a namespace is generated named
+  ``FrobbleKind`` that has a anonymous enumeration with the enumerators
----------------
AaronBallman wrote:

```suggestion
  ``FrobbleKind`` that has an unscoped enumeration with the enumerators
```

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


More information about the cfe-commits mailing list