summaryrefslogtreecommitdiffstats
path: root/clang/lib/Sema/SemaDecl.cpp
diff options
context:
space:
mode:
authorAlexey Bataev <a.bataev@hotmail.com>2019-10-08 14:56:20 +0000
committerAlexey Bataev <a.bataev@hotmail.com>2019-10-08 14:56:20 +0000
commit6b06ead19be79fd6e2d2abdda4c4cbb7c8f3c7c0 (patch)
tree9aa3f1510cb247d1c716dc6b4c2b4777ee70c465 /clang/lib/Sema/SemaDecl.cpp
parentc864f73e45ce138040b14d54dd4ad2bdcba396ea (diff)
downloadbcm5719-llvm-6b06ead19be79fd6e2d2abdda4c4cbb7c8f3c7c0.tar.gz
bcm5719-llvm-6b06ead19be79fd6e2d2abdda4c4cbb7c8f3c7c0.zip
[OPENMP50]Allow functions in declare variant directive to have different
C linkage. After some discussion with OpenMP developers, it was decided that the functions with the different C linkage can be used in declare variant directive. llvm-svn: 374057
Diffstat (limited to 'clang/lib/Sema/SemaDecl.cpp')
-rw-r--r--clang/lib/Sema/SemaDecl.cpp7
1 files changed, 4 insertions, 3 deletions
diff --git a/clang/lib/Sema/SemaDecl.cpp b/clang/lib/Sema/SemaDecl.cpp
index db89e54c517..4a027d86819 100644
--- a/clang/lib/Sema/SemaDecl.cpp
+++ b/clang/lib/Sema/SemaDecl.cpp
@@ -9685,7 +9685,7 @@ bool Sema::areMultiversionVariantFunctionsCompatible(
const PartialDiagnosticAt &NoteCausedDiagIDAt,
const PartialDiagnosticAt &NoSupportDiagIDAt,
const PartialDiagnosticAt &DiffDiagIDAt, bool TemplatesSupported,
- bool ConstexprSupported) {
+ bool ConstexprSupported, bool CLinkageMayDiffer) {
enum DoesntSupport {
FuncTemplates = 0,
VirtFuncs = 1,
@@ -9778,7 +9778,7 @@ bool Sema::areMultiversionVariantFunctionsCompatible(
if (OldFD->getStorageClass() != NewFD->getStorageClass())
return Diag(DiffDiagIDAt.first, DiffDiagIDAt.second) << StorageClass;
- if (OldFD->isExternC() != NewFD->isExternC())
+ if (!CLinkageMayDiffer && OldFD->isExternC() != NewFD->isExternC())
return Diag(DiffDiagIDAt.first, DiffDiagIDAt.second) << Linkage;
if (CheckEquivalentExceptionSpec(
@@ -9831,7 +9831,8 @@ static bool CheckMultiVersionAdditionalRules(Sema &S, const FunctionDecl *OldFD,
PartialDiagnosticAt(NewFD->getLocation(),
S.PDiag(diag::err_multiversion_diff)),
/*TemplatesSupported=*/false,
- /*ConstexprSupported=*/!IsCPUSpecificCPUDispatchMVType);
+ /*ConstexprSupported=*/!IsCPUSpecificCPUDispatchMVType,
+ /*CLinkageMayDiffer=*/false);
}
/// Check the validity of a multiversion function declaration that is the
OpenPOWER on IntegriCloud