Skip to content
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

Added parse-only support for pure virtual methods #469

Draft
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

svenka3
Copy link
Contributor

@svenka3 svenka3 commented Jan 4, 2021

Signed-off-by: Srinivasan Venkataramanan [email protected]

@caryr caryr marked this pull request as draft January 4, 2021 19:42
@caryr
Copy link
Collaborator

caryr commented Jan 4, 2021

See my comments in #468. Do we also need a test that verify this is parsed correctly? What about failing test when they forget to define the method?

I'm making this a draft because I do not think it is ready to commit yet.

@svenka3
Copy link
Contributor Author

svenka3 commented Jan 5, 2021

On "failing test" - a test can be written and added to regression, however the infrastructure needed to enforce this feature needs to be developed and am not sure if it can be done in parse.y alone - sure we can add a make_pure_virtual in property_qual.h

But to really ensure that pure virtual is implemented in a concrete/derived class, will require multiple file parsing and what I added for now is a start to that journey.

Also I remember reading that Icarus today does not really check/do-the-right-thing for:

  • virtual class (abstract class)
  • virtual methods

Hence it will be harder to do these checks at this stage I guess. The best we can do is to add a clear warning.

Am not in a hurry to push this tiny check-in/PR, but rather saying we have to take smaller steps - IMHO.

Thanks

@steveicarus
Copy link
Owner

Can you rebase this to the current master? The base of this branch does not include the updated regression test suite, and also missing a lot of work that has happened in the mean time. A rebase will help a lot.

Comment on lines +917 to +921
| pure_virtual_method_decl
{ yywarn(@1, "OOP Pure Virtual methods are supported as parse-only. "
"No enforcement is done for a concrete class to define these further");
}

Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We really need a "Sorry" message here, and not a warning. Since the feature is supported, it should generate an error, and a "Sorry" message (see examples elsewhere in the code) is the convention for expressing that.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants