On 29/10/24 19:19 -0400, David Malcolm wrote:
This patch generalizes diagnostic_context so that rather than having
a single output format, it has a vector of zero or more.

[snip]

+/* Class for parsing the arguments of -fdiagnostics-add-output= and
+   -fdiagnostics-set-output=, and making diagnostic_output_format
+   instances (or issuing errors).  */
+
+class output_factory
+{
+public:
+  class handler
+  {
+  public:
+    handler (std::string name) : m_name (name) {}

How long are these names?

If they don't fit in 15 chars, then this should be std::move(name).

So for a name like "sarif:version=2.1" it should be moved, otherwise
you make a deep copy and reallocate a new string.


Reply via email to