Add class name in the error msg about calling 'new' on virtual class (#4739)

This commit is contained in:
Ryszard Rozak
2023-12-05 16:31:59 +01:00
committed by GitHub
parent ea2084392f
commit ca5a7d7656
6 changed files with 59 additions and 4 deletions
+3 -2
View File
@@ -3840,8 +3840,9 @@ class WidthVisitor final : public VNVisitor {
classp->v3fatalSrc("Can't find class's new");
}
if (classp->isVirtual() || classp->isInterfaceClass()) {
nodep->v3error(
"Illegal to call 'new' using an abstract virtual class (IEEE 1800-2017 8.21)");
nodep->v3error("Illegal to call 'new' using an abstract virtual class "
+ AstNode::prettyNameQ(classp->origName())
+ " (IEEE 1800-2017 8.21)");
}
} else { // super.new case
// in this case class and taskp() should be properly linked in V3LinkDot.cpp during