summaryrefslogtreecommitdiff
path: root/source/slang/slang-check-stmt.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'source/slang/slang-check-stmt.cpp')
-rw-r--r--source/slang/slang-check-stmt.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/source/slang/slang-check-stmt.cpp b/source/slang/slang-check-stmt.cpp
index 729b24d35..f7b085579 100644
--- a/source/slang/slang-check-stmt.cpp
+++ b/source/slang/slang-check-stmt.cpp
@@ -392,7 +392,7 @@ namespace Slang
auto function = getParentFunc();
if (!stmt->expression)
{
- if (function && !function->returnType.equals(m_astBuilder->getVoidType()))
+ if (function && !function->returnType.equals(m_astBuilder->getVoidType()) && !as<ConstructorDecl>(function))
{
getSink()->diagnose(stmt, Diagnostics::returnNeedsExpression);
}