RFC: JEP JDK-8208089: Implement C++14 Language Features
Magnus Ihse Bursie
magnus.ihse.bursie at oracle.com
Thu Oct 4 12:31:43 UTC 2018
> 4 okt. 2018 kl. 10:57 skrev Martijn Verburg <martijnverburg at gmail.com>:
> Hi Kim,
> I like this initiative. I'm wondering if some of these rules can be easily
> codified or written into a jcheck style checker (ccheck?) so that Authors
> can adhere to the conventions and not rely on a Human review to pick out
> where that convention isn't met.
That's an interesting thought!
I googled around a bit, but could find no obvious candidate for doing such a check. In fact, parsing and analyzing C++ seems quite a hard problem, compared to many other languages. (Sad, but not really surprising.)
I found two possible routes to explore: cpplint , the official Google tool to verify that the Google C++ Style Guide  is followed, and Vera++ , a framework for creating scripts that can analyze and/or transform C++ code.
Neither seem like an ideal solution. The Google tool is hard coded to support the Google rules. It's possible we can fork it and add our own, but it's not clear that this is even possible, much less so that it's a good way forward. Vera++, on the other hand, seems much more likely to be able to provide the tooling needed to write checks that enforce these rules. However, what we have is just a framework, and someone's got to write those rules (in TCL of all languages...). Then again, Vera++ is an old and quite popular tool, so its possible there is already a bunch of predefined rules that we can use as a starting point out there. (I didn't go that far in my analysis).
Apart from these two, there appear to be no popular, well-encompassing, open source C++ checker out there, that could possibly be verifying rules like these. :(
>> On Wed, 3 Oct 2018 at 20:13, Kim Barrett <kim.barrett at oracle.com> wrote:
>> I've submitted a JEP for
>> (1) enabling the use of C++14 Language Features when building the JDK,
>> (2) define a process for deciding and documenting which new features
>> can be used or are forbidden in HotSpot code,
>> (3) provide an initial list of permitted and forbidden new features.
More information about the core-libs-dev