From 57948c63e0ea76b12cf7c41f16ba6564f47497f0 Mon Sep 17 00:00:00 2001 From: Jon Ross-Perkins Date: Fri, 9 Feb 2024 12:57:19 -0800 Subject: [PATCH] Small cleanup for DiagnosticType (#3697) I was thinking about #3695 a little further after comments; this is a small cleanup. --- toolchain/diagnostics/diagnostic_emitter.h | 15 ++++----------- 1 file changed, 4 insertions(+), 11 deletions(-) diff --git a/toolchain/diagnostics/diagnostic_emitter.h b/toolchain/diagnostics/diagnostic_emitter.h index 3ddd64b69bac0..65246c5fd493a 100644 --- a/toolchain/diagnostics/diagnostic_emitter.h +++ b/toolchain/diagnostics/diagnostic_emitter.h @@ -180,21 +180,14 @@ concept HasDiagnosticType = requires { std::type_identity(); }; // The default implementation with no translation. -template -struct DiagnosticTypeForArg { - using StorageType = Arg; - static constexpr DiagnosticTypeTranslation Translation = - DiagnosticTypeTranslation::None; -}; +template +struct DiagnosticTypeForArg + : public DiagnosticTypeInfo {}; // Exposes a custom translation for an argument type. template requires HasDiagnosticType -struct DiagnosticTypeForArg { - using StorageType = Arg::DiagnosticType::StorageType; - static constexpr DiagnosticTypeTranslation Translation = - Arg::DiagnosticType::Translation; -}; +struct DiagnosticTypeForArg : public Arg::DiagnosticType {}; // Use the DIAGNOSTIC macro to instantiate this. // This stores static information about a diagnostic category.