Fix crash on empty '#()' parameter list on class instance (#8182)

The following used to crash:

```systemverilog
    class base #(type T = int); endclass
    class derived extends base; endclass
    derived #() d; // <- crash due to '#()'
```
This commit is contained in:
Geza Lore
2026-08-21 18:16:09 +02:00
committed by GitHub
parent a7ecba4f4e
commit d1067002da
4 changed files with 132 additions and 2 deletions
+5
View File
@@ -3918,6 +3918,11 @@ class LinkDotResolveVisitor final : public VNVisitor {
// Primitive parameter is really a delay2 we can just ignore
VL_DO_DANGLING(pushDeletep(nodep->unlinkFrBack()), nodep);
return;
} else if (nodep->param() && !nodep->exprp() && !nodep->svDotName()) {
// Placeholder pin the parser makes for an empty '#()', to signal
// the user did type the '#()'. No further use, deleting.
VL_DO_DANGLING(pushDeletep(nodep->unlinkFrBack()), nodep);
return;
} else {
const std::string suggest
= (nodep->param() ? m_statep->suggestSymFlat(m_pinSymp, nodep->name(),