aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorMarcoFalke <falke.marco@gmail.com>2021-02-23 14:03:24 +0100
committerMarcoFalke <falke.marco@gmail.com>2021-02-23 14:03:29 +0100
commit84f6c695c6a2f2126ef693dc8c22e7a579c47b7f (patch)
treedaf1dff33be17bae397eced813c78c6d253903c8 /src
parentc263c3d7d2a4b85fe133c5d8018c6ec53b8c942a (diff)
parent5e531e6beb5381c0be5efaa24b7e423e593568e4 (diff)
downloadbitcoin-84f6c695c6a2f2126ef693dc8c22e7a579c47b7f.tar.xz
Merge #21274: assumptions: Assume C++17
5e531e6beb5381c0be5efaa24b7e423e593568e4 assumptions: check C++17 assumption with MSVC (fanquake) c7b46489f8c4d880382248fb47266d81948bbce0 assumptions: assume a C++17 compiler (fanquake) Pull request description: This has been the case since #20413. This should also enable the check for MSVC. From my reading of https://docs.microsoft.com/en-us/cpp/build/reference/zc-cplusplus?view=msvc-160 and https://devblogs.microsoft.com/cppblog/msvc-now-correctly-reports-__cplusplus/ if we set the `/Zc:__cplusplus` switch in additional options, MSVC will report the correct value for `__cplusplus`. However I have not tested this. ACKs for top commit: laanwj: Code review ACK 5e531e6beb5381c0be5efaa24b7e423e593568e4 hebasto: ACK 5e531e6beb5381c0be5efaa24b7e423e593568e4, checked the MS docs, and AppVeyor build is green. practicalswift: ACK 5e531e6beb5381c0be5efaa24b7e423e593568e4 Tree-SHA512: a4fb525cf5c33abc944c614edb0313a39c8a39a1637a03c09342c15ba0925f4eb037062e65e51b42ade667506b7e554c7159acf86e6b8c35d0a87dd79a6f239b
Diffstat (limited to 'src')
-rw-r--r--src/compat/assumptions.h14
1 files changed, 5 insertions, 9 deletions
diff --git a/src/compat/assumptions.h b/src/compat/assumptions.h
index 301c2d914c..5f50cde3ff 100644
--- a/src/compat/assumptions.h
+++ b/src/compat/assumptions.h
@@ -17,16 +17,12 @@
# error "Bitcoin cannot be compiled without assertions."
#endif
-// Assumption: We assume a C++11 (ISO/IEC 14882:2011) compiler (minimum requirement).
-// Example(s): We assume the presence of C++11 features everywhere :-)
-// Note: MSVC does not report the expected __cplusplus value due to legacy
-// reasons.
-#if !defined(_MSC_VER)
-// ISO Standard C++11 [cpp.predefined]p1:
-// "The name __cplusplus is defined to the value 201103L when compiling a C++
+// Assumption: We assume a C++17 (ISO/IEC 14882:2017) compiler (minimum requirement).
+// Example(s): We assume the presence of C++17 features everywhere :-)
+// ISO Standard C++17 [cpp.predefined]p1:
+// "The name __cplusplus is defined to the value 201703L when compiling a C++
// translation unit."
-static_assert(__cplusplus >= 201103L, "C++11 standard assumed");
-#endif
+static_assert(__cplusplus >= 201703L, "C++17 standard assumed");
// Assumption: We assume the floating-point types to fulfill the requirements of
// IEC 559 (IEEE 754) standard.