summaryrefslogtreecommitdiffstats
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.cpp10
1 files changed, 10 insertions, 0 deletions
diff --git a/source/slang/slang-check-stmt.cpp b/source/slang/slang-check-stmt.cpp
index a61f48af6..6efc3e52e 100644
--- a/source/slang/slang-check-stmt.cpp
+++ b/source/slang/slang-check-stmt.cpp
@@ -339,6 +339,16 @@ namespace Slang
void SemanticsStmtVisitor::visitExpressionStmt(ExpressionStmt *stmt)
{
stmt->expression = CheckExpr(stmt->expression);
+ if (auto operatorExpr = as<OperatorExpr>(stmt->expression))
+ {
+ if (auto func = as<VarExpr>(operatorExpr->functionExpr))
+ {
+ if (func->name && func->name->text == "==")
+ {
+ getSink()->diagnose(operatorExpr, Diagnostics::danglingEqualityExpr);
+ }
+ }
+ }
}
void SemanticsStmtVisitor::tryInferLoopMaxIterations(ForStmt* stmt)