normalizeTypeFromSignature: Update for Clang 13

Clang 13 now outputs "unnamed struct" just like GCC, while it earlier
used to output "anonymous struct" (since
https://reviews.llvm.org/D96807).

Therefore, for Q_CC_CLANG check for both "anonymous" and "unnamed".

This fixes the QMetaType testcase when built with Clang 13.

Change-Id: I34de8c2ca05c0e691fbb990b001f011b0f336dc3
Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
This commit is contained in:
Martin Storsjö 2021-09-08 13:52:10 +03:00
parent 39f0633f0b
commit a126b9be89

View File

@ -1935,10 +1935,9 @@ public:
#if defined (Q_CC_CLANG)
if (name.find("anonymous ") != std::string_view::npos)
return normalizeType(begin, end);
#else
#endif
if (name.find("unnamed ") != std::string_view::npos)
return normalizeType(begin, end);
#endif
while (begin < end) {
if (*begin == ' ') {
if (last == ',' || last == '>' || last == '<' || last == '*' || last == '&') {