mirror of
https://github.com/verilator/verilator.git
synced 2026-08-31 10:04:40 +02:00
Signed-off-by: Kamil Rakoczy <[email protected]>
This commit is contained in:
@@ -100,9 +100,15 @@ private:
|
||||
if (local || prot) {
|
||||
const auto refClassp = VN_CAST(m_modp, Class);
|
||||
const char* how = nullptr;
|
||||
if (local && defClassp && refClassp != defClassp) {
|
||||
// Inner nested classes can access `local` or `protected` members of their outer class
|
||||
const auto nestedAccess = [refClassp](const AstClass*, const AstNode* memberp) {
|
||||
return memberp == refClassp;
|
||||
};
|
||||
if (local && defClassp
|
||||
&& ((refClassp != defClassp) && !(defClassp->existsMember(nestedAccess)))) {
|
||||
how = "'local'";
|
||||
} else if (prot && defClassp && !AstClass::isClassExtendedFrom(refClassp, defClassp)) {
|
||||
} else if (prot && defClassp && !AstClass::isClassExtendedFrom(refClassp, defClassp)
|
||||
&& !(defClassp->existsMember(nestedAccess))) {
|
||||
how = "'protected'";
|
||||
}
|
||||
if (how) {
|
||||
|
||||
Reference in New Issue
Block a user