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

Jeff Hammond via cfe-dev cfe-dev at lists.llvm.org
Thu Oct 12 09:18:40 PDT 2017


On Thu, Oct 12, 2017 at 7:39 AM Brian Cain via cfe-dev <
cfe-dev at lists.llvm.org> wrote:

> > -----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.


+1

Please do not deliberately break standard conformance when apparently
standard-enforcing flags are used.

Jeff
-- 
Jeff Hammond
jeff.science at gmail.com
http://jeffhammond.github.io/
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/cfe-dev/attachments/20171012/93d2e2ef/attachment.html>


More information about the cfe-dev mailing list