diff options
Diffstat (limited to 'clang/lib/Sema/SemaOpenMP.cpp')
| -rw-r--r-- | clang/lib/Sema/SemaOpenMP.cpp | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/clang/lib/Sema/SemaOpenMP.cpp b/clang/lib/Sema/SemaOpenMP.cpp index 0403f11f6b7..17586c90bd1 100644 --- a/clang/lib/Sema/SemaOpenMP.cpp +++ b/clang/lib/Sema/SemaOpenMP.cpp @@ -4931,11 +4931,15 @@ Sema::checkOpenMPDeclareVariantFunction(Sema::DeclGroupPtrTy DG, } // Allow #pragma omp declare variant only if the function is not used. - if (FD->isUsed(false)) { - Diag(SR.getBegin(), diag::err_omp_declare_variant_after_used) + if (FD->isUsed(false)) + Diag(SR.getBegin(), diag::warn_omp_declare_variant_after_used) + << FD->getLocation(); + + // Check if the function was emitted already. + if ((LangOpts.EmitAllDecls && FD->isDefined()) || + Context.DeclMustBeEmitted(FD)) + Diag(SR.getBegin(), diag::warn_omp_declare_variant_after_emitted) << FD->getLocation(); - return None; - } // The VariantRef must point to function. if (!VariantRef) { |

