File tree Expand file tree Collapse file tree 1 file changed +4
-6
lines changed Expand file tree Collapse file tree 1 file changed +4
-6
lines changed Original file line number Diff line number Diff line change @@ -1991,8 +1991,7 @@ static void DiagnoseNonTriviallyRelocatableReason(Sema &SemaRef,
19911991 const CXXRecordDecl *D) {
19921992 for (const CXXBaseSpecifier &B : D->bases ()) {
19931993 const auto *BaseDecl = B.getType ()->getAsCXXRecordDecl ();
1994- if (!BaseDecl)
1995- continue ;
1994+ assert (BaseDecl && " invalid base?" );
19961995 if (B.isVirtual ())
19971996 SemaRef.Diag (Loc, diag::note_unsatisfied_trait_reason)
19981997 << diag::TraitNotSatisfiedReason::VBase << B.getType ()
@@ -2003,9 +2002,8 @@ static void DiagnoseNonTriviallyRelocatableReason(Sema &SemaRef,
20032002 << B.getSourceRange ();
20042003 }
20052004 for (const FieldDecl *Field : D->fields ()) {
2006- if (Field->getType ()->isReferenceType ())
2007- continue ;
2008- if (!SemaRef.IsCXXTriviallyRelocatableType (Field->getType ()))
2005+ if (!Field->getType ()->isReferenceType () &&
2006+ !SemaRef.IsCXXTriviallyRelocatableType (Field->getType ()))
20092007 SemaRef.Diag (Loc, diag::note_unsatisfied_trait_reason)
20102008 << diag::TraitNotSatisfiedReason::NRField << Field << Field->getType ()
20112009 << Field->getSourceRange ();
@@ -2077,7 +2075,7 @@ static void DiagnoseNonTriviallyRelocatableReason(Sema &SemaRef,
20772075 << diag::TraitNotSatisfiedReason::HasArcLifetime;
20782076
20792077 const CXXRecordDecl *D = T->getAsCXXRecordDecl ();
2080- if (!D)
2078+ if (!D || D-> isInvalidDecl () )
20812079 return ;
20822080
20832081 if (D->hasDefinition ())
You can’t perform that action at this time.
0 commit comments