Improve error that assert-under-assert is unsupported

This commit is contained in:
Wilson Snyder
2023-09-03 09:08:43 -04:00
parent c8c980c49d
commit de77f1ee5c
5 changed files with 74 additions and 2 deletions
+3 -1
View File
@@ -89,7 +89,9 @@ private:
}
}
void visit(AstNodeCoverOrAssert* nodep) override {
if (m_assertp) nodep->v3error("Assert not allowed under another assert");
if (m_assertp) {
nodep->v3warn(E_UNSUPPORTED, "Unsupported: Assert not allowed under another assert");
}
m_assertp = nodep;
iterateChildren(nodep);
m_assertp = nullptr;