summaryrefslogtreecommitdiffstats
path: root/source
diff options
context:
space:
mode:
authorYong He <yonghe@outlook.com>2020-11-16 11:18:55 -0800
committerGitHub <noreply@github.com>2020-11-16 11:18:55 -0800
commit46e19015fd1046161f24f315deff0411008eafdb (patch)
treec9b636667b5a79b69a765da2ebf6dbfd464055f6 /source
parent2c893d3538b066b03249f5d9caffb0ebc8fbb948 (diff)
Fix VS2017 Warnings (#1602)
* Fix VS2017 Warnings * Update slang-visitor.h Co-authored-by: jsmall-nvidia <jsmall@nvidia.com>
Diffstat (limited to 'source')
-rw-r--r--source/slang/slang-visitor.h10
1 files changed, 10 insertions, 0 deletions
diff --git a/source/slang/slang-visitor.h b/source/slang/slang-visitor.h
index 25e0aafe4..eef029acc 100644
--- a/source/slang/slang-visitor.h
+++ b/source/slang/slang-visitor.h
@@ -55,6 +55,12 @@ struct ITypeVisitor
SLANG_CHILDREN_ASTNode_Type(SLANG_CLASS_ONLY, SLANG_VISITOR_DISPATCH_DECL)
};
+// Suppress VS2017 Unreachable code warning
+#ifdef _MSC_VER
+# pragma warning(push)
+# pragma warning(disable:4702)
+#endif
+
template<typename Derived, typename Result = void, typename Base = ITypeVisitor>
struct TypeVisitor : Base
{
@@ -305,6 +311,10 @@ struct ValVisitor<Derived, void, void> : TypeVisitor<Derived, void, IValVisitor>
SLANG_CHILDREN_ASTNode_Val(SLANG_VISITOR_VOID_VISIT_IMPL, _)
};
+// Re-activate VS2017 warning settings
+#ifdef _MSC_VER
+# pragma warning(pop)
+#endif
}
#endif