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

Compile error on keyword override #20

Open
valmat opened this issue Mar 10, 2019 · 0 comments
Open

Compile error on keyword override #20

valmat opened this issue Mar 10, 2019 · 0 comments

Comments

@valmat
Copy link

valmat commented Mar 10, 2019

I don't sure that is an error, but i had got error with this example:

struct Derived1 : Base
{
    virtual int foo(int n) override
        [[expects: n < 10]]
        [[ensures r: r > 100]]
    {
        return n*n;
    }
};
error: expected ';' at end of declaration list
    virtual int foo(int n) override
                                   ^
                                   ;

If kw override moved after contract attributes no error appears:

struct Derived1 : Base
{
    virtual int foo(int n)
        [[expects: n < 10]]
        [[ensures r: r > 100]]
    override
    {
        return n*n;
    }
};
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

No branches or pull requests

1 participant