[cfe-dev] -Winvalid-constexpr reports as a compile error - is this intentional?

Hans Wennborg via cfe-dev cfe-dev at lists.llvm.org
Wed Jul 4 07:50:41 PDT 2018


Hi Paul,

On Wed, Jul 4, 2018 at 9:52 AM, Paul Bristow via cfe-dev
<cfe-dev at lists.llvm.org> wrote:
> I have (inadvertently) enabled Clang 6.0.0 warning
>
>    -Winvalid-constexpr
>
> This revealed a pre-existing 'feature' in Boost.System error_code.hpp and signalled this as a compile error.
>
> Since this is only advertised as a warning, I was surprised (and slightly inconvenienced) to get an error rather than a warning.
>
> If I suppress the warning (-Wno-invalid-constexpr for example), the code compiles, links and works as expected.
>
> Is signalling this warning as a compile error intentional?

I think this is intentional, and it's even documented:
https://clang.llvm.org/docs/DiagnosticsReference.html#winvalid-constexpr

I don't think it's advertised as a warning. It's an actual error, just
one that's possible to turn off.

 - Hans



More information about the cfe-dev mailing list