diff --git a/clang/lib/Sema/Sema.cpp b/clang/lib/Sema/Sema.cpp index a401017d4c1c0..2d175c9b9a791 100644 --- a/clang/lib/Sema/Sema.cpp +++ b/clang/lib/Sema/Sema.cpp @@ -2050,7 +2050,7 @@ void Sema::checkTypeSupport(QualType Ty, SourceLocation Loc, ValueDecl *D) { targetDiag(D->getLocation(), diag::note_defined_here, FD) << D; } - if (Ty->isRVVType()) + if (TI.hasRISCVVTypes() && Ty->isRVVType()) checkRVVTypeSupport(Ty, Loc, D); // Don't allow SVE types in functions without a SVE target.