Lenexa C++ Meeting Report (Core Language)
Red Hat sent four engineers to the spring C++ meeting this year, in Lenexa, Kansas, a suburb of Kansas City. It was hosted by Perceptive Software, a division of Lexmark. The meeting went very smoothly overall; while there were some disagreements they were pretty cordial.
The first disagreement came up during the Monday evening session when Bjarne was talking about his vision of C++17. He wants to see multiple big new features, lest people get bored with C++ after another relatively minor update like C++14. Google representatives and Herb Sutter (the Convener) pointed out that what they’ve been hearing from users is that they’re happier than ever with C++, and use of C++ has been increasing on available metrics, so what we’ve been doing seems to be working. Personally, I’m happy to continue with Herb’s plan to do regular releases with whatever happens to be ready at the time, much like GCC releases.
I spent most of the week in the Core Language working group, as usual, but visited Evolution for the discussion of Gabriel dos Reis’s Modules proposal, based on an implementation in VC++ that has been well-received within Microsoft. Clang has a different implementation that is being used within Google that involves separate files describing what modules correspond to which headers, rather than anything in the source, but they don’t really see that representation as a candidate for standardization, so they are happy to adopt most of the syntax that Gaby is proposing.
There was some disagreement between the two Modules camps on various smaller points in the larger EWG meeting. One disagreement had to do with whether two modules can define an entity with the same scope and name; Gaby said yes, the Clang folks said no. A poll of the room split the difference: two imported modules exporting the same name is an ODR violation, but two modules can have non-exported entities with the same name. This seems like the right answer to me.
The other major disagreement in the EWG meeting had to do with whether there should be a single file that declares all the exports. Gaby’s proposal has one, there was resistance to it from some Clang folks, but they were more open to it later in the meeting. It seems to me that it shouldn’t be a problem for them; such a file is not significantly different from a header file, which is what the Clang implementation is based on.
There was general agreement that modules can be combined with headers as a transition mechanism: the header can define any macros and then import the module.
There was general agreement that modules are not intended to be a distribution system.
Gaby proposed that private members of exported classes be invisible to importers, but the room was very skeptical, and that item is being dropped from the proposal.
There was qualified agreement that there needs to be some form of forward declaration for imported entities, to break dependency cycles. Gaby wanted such a declaration to name the module we expect to get it from; the Clang camp didn’t want to require that, but was open to making it optional.
Back in Core, we spent some time earlier in the week dealing with national body comments on the Concepts PDTS. The ballot hasn’t quite closed yet, but several NBs sent their comments to us directly as well so that we could consider them at the meeting. Many of the comments were editorial; a few were minor enhancements that we agreed with. Requests that would require more consideration in EWG we decided not to address in this TS: when people have had more experience with the feature as specified in the TS, we can make any appropriate changes when incorporating Concepts into the standard. The expectation is that we will see a revised draft at one of the CWG teleconferences and accept that for publication as a TS.
We also reviewed the fixes from SG1 for issues in the Transactional Memory PDTS and approved them after minor edits, so that we were ready to approve it for publication as a TS on Friday.
Then much of the week was devoted to issue processing. I’ve volunteered to draft a resolution for issue 1979, defining a subset of alias templates that are actually equivalent to their expansion. The goal is to sort out the paradoxical situation we have now where an alias template instantiation can be “equivalent” to its expansion for declaration matching, but not “functionally equivalent” because it has different SFINAE behavior.
A proposal is coming together in CWG to completely change the model for inheriting constructors: the idea is to treat them more like other using-declarations, and call the base constructor directly rather than create a wrapper in the derived class.
Another change in the works is adding the noexcept-specifier to the type of a function. GCC has always internally represented the exception-specifier as part of the FUNCTION_TYPE, but the committee basically never cared enough about exception specifiers to fix this hole, core issue 92. Now there is more interest, and CWG approved proposed wording, but there was nervousness from library implementers at the Friday meeting, so we’re going to postpone voting it in until the next meeting.
CWG looked at the Core impact of a library proposal for source code location information, to replace use of __ FILE__ et al. This requires compiler magic to handle using it in default arguments and get the call site location rather than the location of the default argument definition. This proposal was incorporated in to the draft of the Library Fundamentals V2 TS at the end of the meeting.
We also looked at wording for one of the Coroutines proposals, which still needs work. I’m a bit dubious that EWG sent it to us in the first place: not because of wording issues, which there will always be, but because it seems that they haven’t actually decided that they want this proposal in the language, and Core is too busy to spend time on speculative work like this.
At several points during the meeting people came to me with their pet bug reports, which was fun. A couple of them were from someone who is experimenting with the concepts branch, so I think it was especially helpful to get those issues out of the way to get better insight into the Concepts design as early as possible.
The next meeting is in October, back in Kona, HI. We’re planning to have three meetings in 2016, but the first and third aren’t planned yet; the summer meeting will be in Oulu, Finland.
Join the Red Hat Developer Program (it’s free) and get access to related cheat sheets, books, and product downloads.