-
-
Notifications
You must be signed in to change notification settings - Fork 606
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
add -std-c++=
#9130
add -std-c++=
#9130
Conversation
Thanks for your pull request and interest in making D better, @thewilsonator! We are looking forward to reviewing it, and you should be hearing from a maintainer soon.
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 referencesYour 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 locallyIf 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#9130" |
d8f7055
to
6367513
Compare
6367513
to
9d07d05
Compare
9d07d05
to
110f58c
Compare
I don't see the advantage of |
See the other thread. |
110f58c
to
9c684a1
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Overall well done, with the design I expected, just a few suggestions to make it even better:
9c684a1
to
b33602c
Compare
@ZombineDev Done. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There are no tests.
b33602c
to
caa0e76
Compare
@jacob-carlborg test added. |
Any last comments? |
Only that there's only one person to convince in signing this off. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm following this discussion for a while now and the amount of time spent on discussing the flag name is shocking. This behavior is what drove many contributors away in the past.
CI failure is unrelated. |
The other thread does not mention a It's redundant and doesn't look good. It's not what C++ compilers use. I suggest reversion. |
This is |
I'm sorry, I don't see |
Whoops, that was originally going to be |
The point is that's an all-too-easy mistake to make with this syntax, and we both botched it :-) Heck, I'll need a sticky note on my monitor to remember this one. |
If you're really going to use it that much you should be putting it in your |
I hate to say it, but if I showed |
#9029 (comment) point 3. |
point 3:
|
Well, |
I don't see how |
And yet rejected by gcc, which instead accepts The inclusion of an My preference, however, is to not to call it by its current (still proposed?) name. In this PR, |
Indeed.
I think some of the standard headers are versioned by If you can come up with a name that captures that, then please go ahead, it would be good to have consistency across the compilers. |
It's still recognized by gcc, as it emits a message:
The important thing about this is NOBODY is confused about c99 and c++98. There is no reason to have to type c++ twice. There is literally nothing better about
That's what the |
|
That's due to the option handling being centralized in gcc. If you pass it a D option, you'll get a similar response. :-)
It is an unfortunate mix where you have two different control flags. For example:
|
Ouch! Well, I'll leave this to your best judgement. I've got no idea if clang has anything like, @JohanEngelen @kinke ? |
I don't know enough about clang's ABI mechanism to know for sure what all the complexities are. Clang does not have an |
Another example I can point to is Well, as of g++-8 ( This is slightly derailed from the original thread of discussion, and of course dmd doesn't get an easy ride as it tries to be compatible with all C++ compilers at the same time. The main point being however is that interfacing with C++ is not a simple binary answer (gcc or clang, c++98 or c++11), and you end up always being stuck with subtle ABI bugs because g++ is either too new or too old for dmd to support. Anyway - and I've said this before - whatever ends up in the front-end, it should be accommodating enough to allow ldc to be compatible with clang and all its oddities, and gdc to be compatible with gcc in lock-step (plus plenty of oddities as well as I've already pointed out). This is why I also point people to put things relating to the system in Target, where ldc and gdc can have full control over semantic and ABI related decisions. This is not how you ask a target-specific question.
Instead, you should be phrasing it as:
The above is perhaps poorly named, and has a questionable signature (it could be |
I've already explained the problem that needs solving in gdc at large, and why I will be doing things slightly differently. As always, dmd is free to do what they want when it comes to the CLI. Having discrepancies between implementing D compilers is a problem solved by using dub. :-) |
There is another way. Simply support the latest g++/clang++ and whatever they do. If people can update their D compiler, they can also update their g++/clang++ compilers. Fortunately, that's free. We don't have the resources to support every outdated variation of other compilers. I've chased these rainbows many times in the past, and it can easily get into a soul-sucking time-consuming grind, with little to no positive results. |
It's not always that simple. It's possible to specify which version of C++ you want to use when compiling. Which version of C++ should we follow, the default when no flag is specified? On macOS, Clang that is shipped with Xcode is usually a custom version of Clang built by Apple and is a snapshot of Clang upstream. For example, they use their own versions for the compiler. The latest version of Apple Clang still defaults to C++98 (or something like that). While, I think, latest upstream version of Clang has C++14 as the default. |
cc @TurkeyMan @CyberShadow @jacob-carlborg @Geod24 @ibuclaw @WalterBright
Alternative to #9029
(I haven't actually tested it because I can't build dmd (due to a lack of disk space I think, I'm working on it))Hmm, nope it jut keep OOMing.No it doesn't like-
s inOption
s.tested, it works.