[cfe-dev] [libc++] RFC: adding a configuration option to enable constexpr constructors in c++1[xy]

Brian Cain via cfe-dev cfe-dev at lists.llvm.org
Thu Oct 12 07:39:26 PDT 2017


> -----Original Message-----
> From: cfe-dev [mailto:cfe-dev-bounces at lists.llvm.org] On Behalf Of Howard
> Hinnant via cfe-dev
...
> Random, untested thought:
> 
> What if in <__config> every _LIBCPP_CONFIG_MACRO was defined like this:
> 
> #ifndef _LIBCPP_CONFIG_MACRO
> 
> // Current configuration goes here
> 
> #endif
> 
> And then clients could compile like this if desired:
> 
> clang++ -D_LIBCPP_CONSTEXPR_AFTER_CXX11=constexpr …
> 
> libc++ stays conformant, but becomes far more configurable.

That seems a little awkward.  What if we added a "-std=clang++11" mode (like "gnu++11" ) that would specify that definition when stdlib=libc++?  If we came up with other good-for-users deviations from the standard, we could enable them in this mode.

-Brian




More information about the cfe-dev mailing list