소스 검색

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 년 전
부모
커밋
fe80cf360d
1개의 변경된 파일1개의 추가작업 그리고 1개의 파일을 삭제
  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) {
     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);
   }