[llvm] a0f48d5 - [NFC] Enable RVALUE_REFERENCE_THIS on MSVC 2019
Nathan James via llvm-commits
llvm-commits at lists.llvm.org
Tue Mar 23 09:40:20 PDT 2021
Author: Nathan James
Date: 2021-03-23T16:40:13Z
New Revision: a0f48d57a96d0d1b69ef6a19138fe2bbffd5fd9d
URL: https://github.com/llvm/llvm-project/commit/a0f48d57a96d0d1b69ef6a19138fe2bbffd5fd9d
DIFF: https://github.com/llvm/llvm-project/commit/a0f48d57a96d0d1b69ef6a19138fe2bbffd5fd9d.diff
LOG: [NFC] Enable RVALUE_REFERENCE_THIS on MSVC 2019
In https://reviews.llvm.org/D72948 This was enabled for all MSVC but reverted as it was determined not to work on some 2017 versions.
The issue is assumed to be fixed on 2019 so enable for 2019 and newer.
Some testing could be done to determine which version of MSVC 2017 support this feature but its safer right now to leave it at 2019.
Reviewed By: aaron.ballman
Differential Revision: https://reviews.llvm.org/D98809
Added:
Modified:
llvm/include/llvm/Support/Compiler.h
Removed:
################################################################################
diff --git a/llvm/include/llvm/Support/Compiler.h b/llvm/include/llvm/Support/Compiler.h
index 9348ada91325..57052b596edb 100644
--- a/llvm/include/llvm/Support/Compiler.h
+++ b/llvm/include/llvm/Support/Compiler.h
@@ -97,7 +97,8 @@
/// Sadly, this is separate from just rvalue reference support because GCC
/// and MSVC implemented this later than everything else. This appears to be
/// corrected in MSVC 2019 but not MSVC 2017.
-#if __has_feature(cxx_rvalue_references) || LLVM_GNUC_PREREQ(4, 8, 1)
+#if __has_feature(cxx_rvalue_references) || LLVM_GNUC_PREREQ(4, 8, 1) || \
+ LLVM_MSC_PREREQ(1920)
#define LLVM_HAS_RVALUE_REFERENCE_THIS 1
#else
#define LLVM_HAS_RVALUE_REFERENCE_THIS 0
More information about the llvm-commits
mailing list