forked from github/verilator
Fix duplicate name check on extern symbols
This commit is contained in:
parent
93517b8378
commit
bea225e191
@ -273,14 +273,16 @@ public:
|
||||
UINFO(4, "Var2 " << fnodep << endl);
|
||||
if (nodep->type() == fnodep->type()) {
|
||||
nodep->v3error("Duplicate declaration of "
|
||||
<< nodeTextType(fnodep) << ": " << nodep->prettyNameQ() << '\n'
|
||||
<< nodeTextType(fnodep) << ": " << AstNode::prettyNameQ(name)
|
||||
<< '\n'
|
||||
<< nodep->warnContextPrimary() << '\n'
|
||||
<< fnodep->warnOther() << "... Location of original declaration\n"
|
||||
<< fnodep->warnContextSecondary());
|
||||
} else {
|
||||
nodep->v3error("Unsupported in C: "
|
||||
<< ucfirst(nodeTextType(nodep)) << " has the same name as "
|
||||
<< nodeTextType(fnodep) << ": " << nodep->prettyNameQ() << '\n'
|
||||
<< nodeTextType(fnodep) << ": " << AstNode::prettyNameQ(name)
|
||||
<< '\n'
|
||||
<< nodep->warnContextPrimary() << '\n'
|
||||
<< fnodep->warnOther() << "... Location of original declaration\n"
|
||||
<< fnodep->warnContextSecondary());
|
||||
|
@ -1,4 +1,4 @@
|
||||
%Error: t/t_class_extern_bad.v:9:16: Duplicate declaration of task: 'nodef'
|
||||
%Error: t/t_class_extern_bad.v:9:16: Duplicate declaration of task: 'extern nodef'
|
||||
9 | extern task nodef();
|
||||
| ^~~~~
|
||||
t/t_class_extern_bad.v:8:16: ... Location of original declaration
|
||||
|
Loading…
Reference in New Issue
Block a user