Skip to content

[Trivial] add func attribs to class Declaration final helpers#7607

Merged
dlang-bot merged 1 commit intomasterfrom
unknown repository
Jan 5, 2018
Merged

[Trivial] add func attribs to class Declaration final helpers#7607
dlang-bot merged 1 commit intomasterfrom
unknown repository

Conversation

@ghost
Copy link

@ghost ghost commented Jan 5, 2018

The same was asked in #7569 so there no reason not to add the attribs to the other helpers.

@ghost ghost requested a review from WalterBright as a code owner January 5, 2018 10:09
@dlang-bot dlang-bot added the Review:Trivial typos, formatting, comments label Jan 5, 2018
@dlang-bot
Copy link
Contributor

Thanks for your pull request, @bbasile! We are looking forward to reviewing it, and you should be hearing from a maintainer soon.

Some tips to help speed things up:

  • smaller, focused PRs are easier to review than big ones

  • try not to mix up refactoring or style changes with bug fixes or feature enhancements

  • provide helpful commit messages explaining the rationale behind each change

Bear in mind that large or tricky changes may require multiple rounds of review and revision.

Please see CONTRIBUTING.md for more information.

Bugzilla references

Your PR doesn't reference any Bugzilla issue.

If your PR contains non-trivial changes, please reference a Bugzilla issue or create a manual changelog.

Copy link
Member

@PetarKirov PetarKirov left a comment

Choose a reason for hiding this comment

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

LGTM

@JinShil
Copy link
Contributor

JinShil commented Jan 5, 2018

Does the const on these affect the C++ interface?

@ghost
Copy link
Author

ghost commented Jan 5, 2018

@ibuclaw, about the c++ interface ?

@dlang-bot dlang-bot merged commit a07821b into dlang:master Jan 5, 2018
@PetarKirov
Copy link
Member

@bbasile sorry, I merged your changes prematurely. You also need to update https://github.com/dlang/dmd/blob/master/src/dmd/declaration.h by adding const to all of the methods that you modified on the D side.

@PetarKirov
Copy link
Member

I missed that, because I thought the auto-tester will check the C++ headers, courtesy of #7520. @ibuclaw how is that we're successfully linking (as seen in https://auto-tester.puremagic.com/show-run.ghtml?projectid=1&runid=2980879&dataid=21094560&isPull=true):

c++ -c -o../generated/linux/release/64/cxxfrontend.o -Wno-deprecated -Wstrict-aliasing -Werror -fno-exceptions -fno-rtti -D__pascal= -DMARS=1 -DTARGET_LINUX=1 -DDM_TARGET_CPU_X86=1 -m64 -fPIC -std=gnu++98 -O2 -Idmd -Idmd/root -Wuninitialized -MMD -MF ../generated/linux/release/64/cxxfrontend.deps tests/cxxfrontend.c

)
while having a CV-qualifier mismatch?

@PetarKirov
Copy link
Member

Actually, since the functions are final (i.e. non-virtual) they are not part of the vtable, hence why we have implementations of those functions both in C++ and D. @bbasile you don't need to update anything on the C++ side, sorry for the confusion.

@ghost
Copy link
Author

ghost commented Jan 5, 2018

NP. The other PR is here in case of.

@ibuclaw
Copy link
Member

ibuclaw commented Jan 5, 2018

You need to use the function in c++ in order to see the mismatch.

dlang-bot added a commit that referenced this pull request Jan 5, 2018
fixup #7607 - set const the helpers in the cpp header too
merged-on-behalf-of: Petar Kirov <ZombineDev@users.noreply.github.com>
@ghost ghost deleted the decl-attribs branch January 5, 2018 13:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Merge:auto-merge Review:Trivial typos, formatting, comments

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants