[clang-doc] Fix assert on startup
authorBrett Wilson <brettw@google.com>
Fri, 12 Aug 2022 18:35:42 +0000 (18:35 +0000)
committerPaul Kirth <paulkirth@google.com>
Fri, 12 Aug 2022 18:37:23 +0000 (18:37 +0000)
commit75c7e79464a3e77043571d187cd8019370326bcb
tree55045b87cf15a7666fd8ea104bda18541a6bdd9d
parent8dd07e36ca0f56bad6ca910b3a0ffe5ed38bc34a
[clang-doc] Fix assert on startup

When using `clang-doc --format=html` it will crash on startup because of an assertion doing a self-assignment of a `SmallString`. This patch removes the self-assignment by creating an intermediate copy.

Reviewed By: paulkirth

Differential Revision: https://reviews.llvm.org/D131793
clang-tools-extra/clang-doc/tool/ClangDocMain.cpp