summaryrefslogtreecommitdiffstats
path: root/clang/lib/Sema/SemaDecl.cpp
diff options
context:
space:
mode:
authorErich Keane <erich.keane@intel.com>2018-02-20 18:44:50 +0000
committerErich Keane <erich.keane@intel.com>2018-02-20 18:44:50 +0000
commit5e5baf59ddc9aecef000350f3207bb686509af01 (patch)
treee5d7e4a676b0e6c7dc24359725916445175c161f /clang/lib/Sema/SemaDecl.cpp
parent2cf3769a7e7fa5aba6a43f3a91f121d6d447762b (diff)
downloadbcm5719-llvm-5e5baf59ddc9aecef000350f3207bb686509af01.tar.gz
bcm5719-llvm-5e5baf59ddc9aecef000350f3207bb686509af01.zip
Correct multiversion unsupported target behavior, add a test.
Multiversioning SEMA failed to set the declaration as invalid on unsupported targets. This patch does that. Additionally, I noticed that there is no test to validate this error message. This patch adds one, and uses 'mips' as the test architecture. llvm-svn: 325610
Diffstat (limited to 'clang/lib/Sema/SemaDecl.cpp')
-rw-r--r--clang/lib/Sema/SemaDecl.cpp2
1 files changed, 2 insertions, 0 deletions
diff --git a/clang/lib/Sema/SemaDecl.cpp b/clang/lib/Sema/SemaDecl.cpp
index 7d7b274b815..ab50b43db24 100644
--- a/clang/lib/Sema/SemaDecl.cpp
+++ b/clang/lib/Sema/SemaDecl.cpp
@@ -9365,6 +9365,7 @@ static bool CheckMultiVersionFunction(Sema &S, FunctionDecl *NewFD,
}
if (!S.getASTContext().getTargetInfo().supportsMultiVersioning()) {
S.Diag(NewFD->getLocation(), diag::err_multiversion_not_supported);
+ NewFD->setInvalidDecl();
return true;
}
@@ -9407,6 +9408,7 @@ static bool CheckMultiVersionFunction(Sema &S, FunctionDecl *NewFD,
if (!S.getASTContext().getTargetInfo().supportsMultiVersioning()) {
S.Diag(NewFD->getLocation(), diag::err_multiversion_not_supported);
S.Diag(OldFD->getLocation(), diag::note_previous_declaration);
+ NewFD->setInvalidDecl();
return true;
}
OpenPOWER on IntegriCloud