# \[RFC\] Use language extensions from future standards in libc++

**URL:** <https://discourse.llvm.org/t/rfc-use-language-extensions-from-future-standards-in-libc/71898>\
**Category:** C++\
**Created:** [July 8, 2023, 6:20am UTC](https://discourse.llvm.org/t/rfc-use-language-extensions-from-future-standards-in-libc/71898 "2023-07-08T06:20:02Z")\
**Posts on this page:** 1\
**Showing post:** 4

<div class="post-metadata">

**Author:** ![mordante](https://avatars.discourse-cdn.com/v4/letter/m/8e7dd6/32.png) [@mordante](https://discourse.llvm.org/u/mordante)\
**Post date:** [July 20, 2023, 3:42pm UTC](https://discourse.llvm.org/t/rfc-use-language-extensions-from-future-standards-in-libc/71898/4 "2023-07-20T15:42:24Z")

</div>

> [@philnik](#):
>
> **Relying on compiler extensions that could be removed in the future**  
> At least according to @AaronBallman (please point out anything that I get wrong!), this is very unlikely to happen. Basically, if we want to use anything that is not documented, we should ask the clang folks if the extension is known and make them document it. If it’s documented, it’s considered _very_ unlikely to be removed at any point. Compilers are a lot less likely to remove extensions than standard libraries are, because having these kinds of extensions is for the most part the difference between a conditional warning (informing the user that a given construct is an extension) and a conditional error (informing the user that the feature they are trying to use is not available). This makes these extensions very low maintenance for compilers.

Thanks for @ldionne to point me to this post.

Have you spoken with the GCC devs too? At least for Clang we the latest HEAD in the libc++ CI and update to snapshort every few weeks. For GCC we update only when they release, so there the breakage might be detected later. I noticed GCC-13.1 can’t be used with libc++ HEAD anymore. I haven’t had time to look into it closely, but it seems to be related to compiler builtins. As mentioned earlier, I really like to know the stance in this regard from the GCC devs. That would really help me to make an informed decision.

Personally think there is a difference between using compiler builtins and relying on undocumented extensions. The builtins are usually documented. Implementing certain library features can’t be done purely from the language. For example, certain type traits require information the compiler has. For optional builtins we typically have a library path to do it.Even when we remove it at some point it can be easily revived from the history.

---

_[View the full topic](https://discourse.llvm.org/t/rfc-use-language-extensions-from-future-standards-in-libc/71898)._
