summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPeter Jas <necmon@yahoo.com>2016-08-10 09:12:51 +0300
committerJan Kotas <jkotas@microsoft.com>2016-08-09 23:12:51 -0700
commit4ddc41e60c6f4382c350b9b5cbcc0fd2e903c1e7 (patch)
tree4395a152cdb4a04e49f1787ce18dfb18a0df7a36
parent37798423fb035625192b4fac90a329e17b90d562 (diff)
downloadcoreclr-4ddc41e60c6f4382c350b9b5cbcc0fd2e903c1e7.tar.gz
coreclr-4ddc41e60c6f4382c350b9b5cbcc0fd2e903c1e7.tar.bz2
coreclr-4ddc41e60c6f4382c350b9b5cbcc0fd2e903c1e7.zip
Fix for VCR 190024210 and Win SDK 10.0.14393.0 (#6674)
-rw-r--r--src/inc/debugreturn.h18
1 files changed, 11 insertions, 7 deletions
diff --git a/src/inc/debugreturn.h b/src/inc/debugreturn.h
index cc5bdebb5a..dbcbd2bb46 100644
--- a/src/inc/debugreturn.h
+++ b/src/inc/debugreturn.h
@@ -27,7 +27,9 @@
#else // !_PREFAST_
-#ifdef _DEBUG
+// This is disabled in VS2015 Update 3 and earlier because only C++11 constexpr is supported,
+// which doesn't allow the use of 'if' statements within the body of a constexpr function.
+#if defined(_DEBUG) && (!defined(_MSC_FULL_VER) || _MSC_FULL_VER > 190024210)
// Code to generate a compile-time error if return statements appear where they
// shouldn't.
@@ -108,15 +110,17 @@ typedef __SafeToReturn __ReturnOK;
#define DEBUG_OK_TO_RETURN_BEGIN(arg) { typedef __SafeToReturn __ReturnOK; if (0 && __ReturnOK::used()) { } else {
#define DEBUG_OK_TO_RETURN_END(arg) } }
-#else // !_DEBUG
+#else // defined(_DEBUG) && (!defined(_MSC_FULL_VER) || _MSC_FULL_VER > 190024210)
-#define DEBUG_ASSURE_NO_RETURN_BEGIN(arg)
-#define DEBUG_ASSURE_NO_RETURN_END(arg)
+#define DEBUG_ASSURE_SAFE_TO_RETURN TRUE
+
+#define DEBUG_ASSURE_NO_RETURN_BEGIN(arg) {
+#define DEBUG_ASSURE_NO_RETURN_END(arg) }
-#define DEBUG_OK_TO_RETURN_BEGIN(arg)
-#define DEBUG_OK_TO_RETURN_END(arg)
+#define DEBUG_OK_TO_RETURN_BEGIN(arg) {
+#define DEBUG_OK_TO_RETURN_END(arg) }
-#endif // !_DEBUG
+#endif // defined(_DEBUG) && (!defined(_MSC_FULL_VER) || _MSC_FULL_VER > 190024210)
#endif // !_PREFAST_