diff --git a/clang/lib/Sema/SemaDecl.cpp b/clang/lib/Sema/SemaDecl.cpp index 575459c3c6920..719215d3f38c4 100644 --- a/clang/lib/Sema/SemaDecl.cpp +++ b/clang/lib/Sema/SemaDecl.cpp @@ -8705,7 +8705,7 @@ void Sema::CheckVariableDeclarationType(VarDecl *NewVD) { } // Check that SVE types are only used in functions with SVE available. - if (T->isSVESizelessBuiltinType() && CurContext->isFunctionOrMethod()) { + if (T->isSVESizelessBuiltinType() && isa(CurContext)) { const FunctionDecl *FD = cast(CurContext); llvm::StringMap CallerFeatureMap; Context.getFunctionFeatureMap(CallerFeatureMap, FD); diff --git a/clang/test/SemaOpenMP/arm-sve-acle-types.cpp b/clang/test/SemaOpenMP/arm-sve-acle-types.cpp new file mode 100644 index 0000000000000..7afa6e9da24da --- /dev/null +++ b/clang/test/SemaOpenMP/arm-sve-acle-types.cpp @@ -0,0 +1,11 @@ +// RUN: %clang_cc1 -fopenmp -fsyntax-only -triple aarch64-arm-none-eabi -target-feature +sve -verify %s +// expected-no-diagnostics + +__SVBool_t foo(int); + +void test() { +#pragma omp parallel + { + __SVBool_t pg = foo(1); + } +}