[clang] [clang] Refactor attr diagnostics to use %select (PR #122473)

Ilya Biryukov via cfe-commits cfe-commits at lists.llvm.org
Mon Jan 13 02:45:57 PST 2025


================
@@ -3708,9 +3709,9 @@ void Parser::ParseDeclarationSpecifiers(
             continue;
 
           if (PA.getKind() == ParsedAttr::AT_LifetimeBound)
-            Diag(PA.getLoc(), diag::err_attribute_wrong_decl_type_str)
----------------
ilya-biryukov wrote:

Makes sense, I didn't see this callsite. Thanks for the expalanation.

I guess one way would be to actually generate the enum declaration for subjects through TableGen too and also reuse the same declarations to point at the right diagnostic.
However, it's definitely a bigger refactoring and this change is already making things better, so let's land this!

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


More information about the cfe-commits mailing list