Revert false-positive static error (#4072) (#4077)

This commit is contained in:
Wilson Snyder 2023-04-01 18:54:37 -04:00
parent 3219ffddd4
commit 86156dd05b
3 changed files with 8 additions and 4 deletions

View File

@ -2670,8 +2670,9 @@ private:
} }
} else { } else {
if (staticAccess && !varp->lifetime().isStatic() && !varp->isParam()) { if (staticAccess && !varp->lifetime().isStatic() && !varp->isParam()) {
nodep->v3error("Static access to non-static member variable " // TODO bug4077
<< varp->prettyNameQ() << endl); // nodep->v3error("Static access to non-static member variable "
// << varp->prettyNameQ() << endl);
} }
AstVarRef* const refp = new AstVarRef{ AstVarRef* const refp = new AstVarRef{
nodep->fileline(), varp, VAccess::READ}; // lvalue'ness computed later nodep->fileline(), varp, VAccess::READ}; // lvalue'ness computed later

View File

@ -1,4 +1,7 @@
%Error: t/t_class_member_bad3.v:16:12: Static access to non-static member variable 'member' %Error: t/t_class_member_bad3.v:16:12: Static access to non-static member variable 'member'
16 | Foo::member = 1; 16 | Foo::member = 1;
| ^~~~~~ | ^~~~~~
%Error: t/t_class_member_bad3.v:17:12: Static access to non-static task/function 'method'
17 | Foo::method();
| ^~~~~~
%Error: Exiting due to %Error: Exiting due to

View File

@ -11,8 +11,8 @@ if (!$::Driver) { use FindBin; exec("$FindBin::Bin/bootstrap.pl", @ARGV, $0); di
scenarios(linter => 1); scenarios(linter => 1);
lint( lint(
fails => 1, # fails => 1, # TODO bug4077
expect_filename => $Self->{golden_filename}, # expect_filename => $Self->{golden_filename},
); );
ok(1); ok(1);