[clang-tidy] Fix crash in modernize-use-trailing-return-type (#70709)
authorPiotr Zegar <me@piotrzegar.pl>
Tue, 31 Oct 2023 05:52:40 +0000 (06:52 +0100)
committerTobias Hieta <tobias@hieta.se>
Tue, 31 Oct 2023 07:59:21 +0000 (08:59 +0100)
commit586481468a073b342a1d7940cc9f65b762a9a6ce
tree7b0a2df465ba5a2072207c8e74e9ca0d6237402c
parent9d0ca259eed64c547b0a28fc7c5c46b9ca66ce9f
[clang-tidy] Fix crash in modernize-use-trailing-return-type (#70709)

Resolved the crash that occurred during the use of a user-defined
C-style string literal. The fix entails checking whether the identifier
is non-empty before attempting to read its name.

(cherry picked from commit a396fb247e0719f56a830a9e4aab0449be7f843a)
clang-tools-extra/clang-tidy/modernize/UseTrailingReturnTypeCheck.cpp
clang-tools-extra/test/clang-tidy/checkers/modernize/use-trailing-return-type-cxx20.cpp