Skip to content

Declare frontend structs as extern cpp#10321

Merged
Geod24 merged 1 commit intodlang:masterfrom
edi33416:externcpp
Aug 21, 2019
Merged

Declare frontend structs as extern cpp#10321
Geod24 merged 1 commit intodlang:masterfrom
edi33416:externcpp

Conversation

@edi33416
Copy link
Contributor

This PR is useful to the the C++ header generator to generate the dmd frontend header files that are used by gdc.

This is necessary because the generator takes into consideration only structs that are declared extern (C++)

@dlang-bot
Copy link
Contributor

Thanks for your pull request and interest in making D better, @edi33416! We are looking forward to reviewing it, and you should be hearing from a maintainer soon.
Please verify that your PR follows this checklist:

  • My PR is fully covered with tests (you can see the coverage diff by visiting the details link of the codecov check)
  • My PR is as minimal as possible (smaller, focused PRs are easier to review than big ones)
  • I have provided a detailed rationale explaining my changes
  • New or modified functions have Ddoc comments (with Params: and Returns:)

Please see CONTRIBUTING.md for more information.


If you have addressed all reviews or aren't sure how to proceed, don't hesitate to ping us with a simple comment.

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.

Testing this PR locally

If you don't have a local development environment setup, you can use Digger to test this PR:

dub fetch digger
dub run digger -- build "master + dmd#10321"

@thewilsonator
Copy link
Contributor

Hmm,

dmd/constfold.d(98): Error: template instance `dmd.complex.complex_t.opUnary!"-"` Internal Compiler Error: C++ `string` template value parameter is not supported

* Typesafe PIMPL idiom so we can keep CompiledCtfeFunction private.
*/
struct CompiledCtfeFunctionPimpl
extern (C++) struct CompiledCtfeFunctionPimpl
Copy link
Member

Choose a reason for hiding this comment

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

This is an internal struct? I think this can be ignored.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

This is because in FuncDeclaration we store a CompiledCtfeFunctionPimpl member field which was manually re-written in the declaration.h header file as CompiledCtfeFunction * (link)

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I also feel that this should stay private, but this was the easiest solution I came up with. Open to suggestions

Copy link
Member

Choose a reason for hiding this comment

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

Ahh... used in func.d, in a rather weird way when comparing against the existing C++ header.

@edi33416
Copy link
Contributor Author

buildkite failure seems to be unrelated

@Geod24 Geod24 merged commit f852913 into dlang:master Aug 21, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants