From: Akira Hatanaka Date: Fri, 8 Feb 2019 19:46:53 +0000 (+0000) Subject: Pass the base element type of an array type to the visit method instead X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=fe80cf360d45b41d75e639f750f1a42806c349a2;p=clang Pass the base element type of an array type to the visit method instead of the array type itself. This fixes a bug found by inspection that was introduced in r353459. I don't have a test case for this since we don't yet have types that would make the containing C struct non-trivial to copy/move but wouldn't make it non-trivial to default-initialize or destruct. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@353556 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/lib/AST/Type.cpp b/lib/AST/Type.cpp index 02943ccef9..477fca328c 100644 --- a/lib/AST/Type.cpp +++ b/lib/AST/Type.cpp @@ -2258,7 +2258,7 @@ struct IsNonTrivialCopyMoveVisitor bool visitWithKind(QualType::PrimitiveCopyKind PCK, QualType QT) { if (const auto *AT = this->Ctx.getAsArrayType(QT)) - return this->asDerived().visit(QualType(AT, 0)); + return this->asDerived().visit(Ctx.getBaseElementType(AT)); return Super::visitWithKind(PCK, QT); }