This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: C++ PATCH for c++/91428 - warn about std::is_constant_evaluated in if constexpr


On Tue, Aug 27, 2019 at 5:50 PM Marek Polacek <polacek@redhat.com> wrote:
>
> As discussed in 91428 and in
> <https://stackoverflow.com/questions/54251530/stdis-constant-evaluated-behavior>,
>
>   if constexpr (std::is_constant_evaluated ())
>     // ...
>   else
>     // ...
>
> always evaluates the true branch.  Someone in the SO post said "But hopefully
> compilers will just diagnose that case" so I'm adding a warning.
>
> I didn't want to invent a completely new warning so I'm tagging along
> -Wtautological-compare.
>
> Bootstrapped/regtested on x86_64-linux, ok for trunk?

OK.

Jason


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]