summaryrefslogtreecommitdiffstats
path: root/clang/lib/Sema
diff options
context:
space:
mode:
authorAlexey Bataev <a.bataev@hotmail.com>2019-09-30 18:24:35 +0000
committerAlexey Bataev <a.bataev@hotmail.com>2019-09-30 18:24:35 +0000
commit218bea9703ef36db8782e601e210615dcfddacb4 (patch)
tree4d923f6024a6d0b851870850e891c6e9f6ea7198 /clang/lib/Sema
parent2331cd69cd7812d13e68a84dc9e1189cb14cff55 (diff)
downloadbcm5719-llvm-218bea9703ef36db8782e601e210615dcfddacb4.tar.gz
bcm5719-llvm-218bea9703ef36db8782e601e210615dcfddacb4.zip
[OPENMP50]Do not emit warning for the function with the currently
defined body. If the function is currently defined, we should not emit a warning that it might be emitted already because it was not really emitted. llvm-svn: 373243
Diffstat (limited to 'clang/lib/Sema')
-rw-r--r--clang/lib/Sema/SemaOpenMP.cpp5
1 files changed, 3 insertions, 2 deletions
diff --git a/clang/lib/Sema/SemaOpenMP.cpp b/clang/lib/Sema/SemaOpenMP.cpp
index f2dc66e383e..b3a2ed62a7c 100644
--- a/clang/lib/Sema/SemaOpenMP.cpp
+++ b/clang/lib/Sema/SemaOpenMP.cpp
@@ -4936,8 +4936,9 @@ Sema::checkOpenMPDeclareVariantFunction(Sema::DeclGroupPtrTy DG,
<< FD->getLocation();
// Check if the function was emitted already.
- if ((LangOpts.EmitAllDecls && FD->isDefined()) ||
- Context.DeclMustBeEmitted(FD))
+ const FunctionDecl *Definition;
+ if (!FD->isThisDeclarationADefinition() && FD->isDefined(Definition) &&
+ (LangOpts.EmitAllDecls || Context.DeclMustBeEmitted(Definition)))
Diag(SR.getBegin(), diag::warn_omp_declare_variant_after_emitted)
<< FD->getLocation();
OpenPOWER on IntegriCloud