================
@@ -2262,7 +2262,9 @@ Sema::SemaDiagnosticBuilder::~SemaDiagnosticBuilder() {
 Sema::SemaDiagnosticBuilder
 Sema::targetDiag(SourceLocation Loc, unsigned DiagID, const FunctionDecl *FD) {
   FD = FD ? FD : getCurFunctionDecl();
-  if (LangOpts.OpenMP)
+  // -fopenmp-simd has no device compilation and ignores 'declare target', so
+  // there is nothing to defer for.
+  if (LangOpts.OpenMP && !LangOpts.OpenMPSimd)
----------------
pgerell wrote:

They aren't both set: `OpenMPSimd = !OpenMP && IsSimdSpecified`, so it means 
"SIMD-only mode". With both flags we take the full OpenMP path, deferral 
included. `OpenMP && !OpenMPSimd` is the usual full-OpenMP check elsewhere in 
clang too. I reworded the comment to say so.

https://github.com/llvm/llvm-project/pull/220316
_______________________________________________
cfe-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to