-
Notifications
You must be signed in to change notification settings - Fork 445
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
No error for extern objects with constructor name matching a different type #435
Comments
Additional comment/question -- the latest P4_16 draft spec says: "Extern declarations can only appear in architecture model libraries specific to a target." p4c doesn't seem to enforce this. Does that statement look correct? If architecture model libraries are in #include files, it doesn't seem like there is even a very straightforward way for the compiler to enforce that restriction? |
Indeed, the compiler cannot enforce this. |
Confirmed that the test case now gives an error message for the thing that looks like a constructor, but has a different type name than the extern object it is within. Thanks, Mihai. |
Happened across this while puzzling through what TYPE meant in the grammar rule for constructor method declarations. I don't think this is a high priority issue, but wanted to file one in case someone else thought it was worth a change in the compiler. See comments inside myExtern1 in the attached program.
wrong-constructor-name.p4.txt
The text was updated successfully, but these errors were encountered: