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

Aaron Ballman via cfe-commits cfe-commits at lists.llvm.org
Tue Jan 14 11:37:39 PST 2025


================
@@ -0,0 +1,16 @@
+// RUN: clang-tblgen --gen-clang-diags-enums -I%S %s 2>&1 | FileCheck %s
+include "DiagnosticBase.inc"
+
+def DupeNames1 : Error<"%enum_select<DupeName>{}0">;
----------------
AaronBallman wrote:

Other test cases:
```
// Missing closing > after the name of the enumeration
%enum_select<Name{}0
// Missing { after the name of an enumerator
%enum_select<Name>{%OtherName|foo}0
// Enumerator name duplicates enumeration name? Maybe this is fine?
%enum_select<Name>{%Name{haha}}0
// No enumerators specified? Maybe this is fine?
%enum_select<Name>{foo|bar|baz}0
```

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


More information about the cfe-commits mailing list