Browse Source

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

Akira Hatanaka 6 years ago
parent
commit
fe80cf360d
1 changed files with 1 additions and 1 deletions
  1. 1 1
      lib/AST/Type.cpp

+ 1 - 1
lib/AST/Type.cpp

@@ -2258,7 +2258,7 @@ struct IsNonTrivialCopyMoveVisitor
 
 
   bool visitWithKind(QualType::PrimitiveCopyKind PCK, QualType QT) {
   bool visitWithKind(QualType::PrimitiveCopyKind PCK, QualType QT) {
     if (const auto *AT = this->Ctx.getAsArrayType(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);
     return Super::visitWithKind(PCK, QT);
   }
   }