diff options
Diffstat (limited to 'gcc/diagnostics/html-sink.cc')
-rw-r--r-- | gcc/diagnostics/html-sink.cc | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/gcc/diagnostics/html-sink.cc b/gcc/diagnostics/html-sink.cc index 13d6309..934d8e2 100644 --- a/gcc/diagnostics/html-sink.cc +++ b/gcc/diagnostics/html-sink.cc @@ -1018,10 +1018,11 @@ html_builder::make_element_for_diagnostic (const diagnostic_info &diagnostic, // Add any metadata as a suffix to the message if (diagnostic.m_metadata) - { - xp.add_text (" "); - xp.append (make_element_for_metadata (*diagnostic.m_metadata)); - } + if (auto e = make_element_for_metadata (*diagnostic.m_metadata)) + { + xp.add_text (" "); + xp.append (std::move (e)); + } // Add any option as a suffix to the message @@ -1234,6 +1235,9 @@ html_builder::make_element_for_metadata (const metadata &m) (make_metadata_element (std::move (label), std::move (url))); } + if (span_metadata->m_children.empty ()) + return nullptr; + return span_metadata; } |