diff options
author | Nico Weber <nicolasweber@gmx.de> | 2019-07-09 00:02:23 +0000 |
---|---|---|
committer | Nico Weber <nicolasweber@gmx.de> | 2019-07-09 00:02:23 +0000 |
commit | 78e282409c49b81d850eee1b4c8550acf878819d (patch) | |
tree | a1d24ba0c8b892c4d05cc68272240104b5b634a5 /lib/Sema/SemaAttr.cpp | |
parent | f56bf0c9906f3c56d7f7811400305e5eaf19ecbd (diff) | |
download | clang-78e282409c49b81d850eee1b4c8550acf878819d.tar.gz |
clang-cl: Port cl.exe's C4659 to clang-cl
Differential Revision: https://reviews.llvm.org/D64349
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@365411 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Sema/SemaAttr.cpp')
-rw-r--r-- | lib/Sema/SemaAttr.cpp | 12 |
1 files changed, 9 insertions, 3 deletions
diff --git a/lib/Sema/SemaAttr.cpp b/lib/Sema/SemaAttr.cpp index e1929e3ec2..8e93188473 100644 --- a/lib/Sema/SemaAttr.cpp +++ b/lib/Sema/SemaAttr.cpp @@ -403,9 +403,15 @@ void Sema::ActOnPragmaMSSeg(SourceLocation PragmaLocation, if (Action & PSK_Pop && Stack->Stack.empty()) Diag(PragmaLocation, diag::warn_pragma_pop_failed) << PragmaName << "stack empty"; - if (SegmentName && - !checkSectionName(SegmentName->getBeginLoc(), SegmentName->getString())) - return; + if (SegmentName) { + if (!checkSectionName(SegmentName->getBeginLoc(), SegmentName->getString())) + return; + + if (SegmentName->getString() == ".drectve" && + Context.getTargetInfo().getCXXABI().isMicrosoft()) + Diag(PragmaLocation, diag::warn_attribute_section_drectve) << PragmaName; + } + Stack->Act(PragmaLocation, Action, StackSlotLabel, SegmentName); } |