From 78e282409c49b81d850eee1b4c8550acf878819d Mon Sep 17 00:00:00 2001 From: Nico Weber Date: Tue, 9 Jul 2019 00:02:23 +0000 Subject: 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 --- lib/Sema/SemaAttr.cpp | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) (limited to 'lib/Sema/SemaAttr.cpp') 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); } -- cgit v1.2.1