[PATCH] D55500: [Builtins] Implement __builtin_is_constant_evaluated for use in C++2a

Bruno Cardoso Lopes via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Mon Jan 7 16:47:01 PST 2019


bruno added inline comments.


================
Comment at: include/clang/Basic/Builtins.def:759
+// Random C++ builtins.
+LANGBUILTIN(__builtin_is_constant_evaluated, "b", "ncu", CXX_LANG)
+
----------------
EricWF wrote:
> EricWF wrote:
> > bruno wrote:
> > > Name bikeshedding : perhaps the builtin name could be detached from the std:: name? Suggestion: `__builtin_in_constant_evaluation_context`
> > I'm not sure detaching it from the `std::` name is desirable. Most importantly it should match w/e GCC does/decides to do.
> > 
> > But if it is, we should name in deference to the standardese it implements. Specifically weither an expression or conversion is //manifestly constant-evaluated// [[expr.const](http://eel.is/c++draft/expr.const#11)]p11.
> > 
> > Therefore I proffer  `__builtin_is_manifestly_constant_evaluated()` or `__builtin_is_being_manifestly_constant_evaluated()`.
> > 
> > 
> Actually, GCC has `__builtin_is_constant_evaluated` so we should use that name too.
Agreed!


Repository:
  rC Clang

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D55500/new/

https://reviews.llvm.org/D55500





More information about the cfe-commits mailing list