[PATCH] D105518: [clang] disable P2266 simpler implicit moves under -fms-compatibility
Matheus Izvekov via Phabricator via cfe-commits
cfe-commits at lists.llvm.org
Tue Jul 6 17:31:11 PDT 2021
mizvekov created this revision.
mizvekov requested review of this revision.
Herald added a project: clang.
Herald added a subscriber: cfe-commits.
The Microsoft STL currently has some issues with P2266 <https://reviews.llvm.org/P2266>.
We disable it for now in that mode, but we might come back later with a
more targetted approach.
Signed-off-by: Matheus Izvekov <mizvekov at gmail.com>
Repository:
rG LLVM Github Monorepo
https://reviews.llvm.org/D105518
Files:
clang/lib/Frontend/InitPreprocessor.cpp
clang/lib/Sema/SemaStmt.cpp
Index: clang/lib/Sema/SemaStmt.cpp
===================================================================
--- clang/lib/Sema/SemaStmt.cpp
+++ clang/lib/Sema/SemaStmt.cpp
@@ -3334,7 +3334,8 @@
return NamedReturnInfo();
NamedReturnInfo Res = getNamedReturnInfo(VD);
if (Res.Candidate && !E->isXValue() &&
- (ForceCXX2b || getLangOpts().CPlusPlus2b)) {
+ (ForceCXX2b ||
+ (getLangOpts().CPlusPlus2b && !getLangOpts().MSVCCompat))) {
E = ImplicitCastExpr::Create(Context, VD->getType().getNonReferenceType(),
CK_NoOp, E, nullptr, VK_XValue,
FPOptionsOverride());
Index: clang/lib/Frontend/InitPreprocessor.cpp
===================================================================
--- clang/lib/Frontend/InitPreprocessor.cpp
+++ clang/lib/Frontend/InitPreprocessor.cpp
@@ -598,7 +598,8 @@
}
// C++2b features.
if (LangOpts.CPlusPlus2b) {
- Builder.defineMacro("__cpp_implicit_move", "202011L");
+ if (!getLangOpts().MSVCCompat)
+ Builder.defineMacro("__cpp_implicit_move", "202011L");
Builder.defineMacro("__cpp_size_t_suffix", "202011L");
}
if (LangOpts.Char8)
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D105518.356842.patch
Type: text/x-patch
Size: 1183 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20210707/c440563c/attachment.bin>
More information about the cfe-commits
mailing list