This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c++/86282] Evaluation order in if constexpr expression seems to be irrelevant for evaluating type traits
- From: "redi at gcc dot gnu.org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Fri, 22 Jun 2018 14:13:44 +0000
- Subject: [Bug c++/86282] Evaluation order in if constexpr expression seems to be irrelevant for evaluating type traits
- Auto-submitted: auto-generated
- References: <bug-86282-4@http.gcc.gnu.org/bugzilla/>
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=86282
--- Comment #4 from Jonathan Wakely <redi at gcc dot gnu.org> ---
(In reply to rene.rahn from comment #2)
> thanks for enlighten me. Before, it wasn't clear to me, that if the nested
> version works, the conjunction does not necessarily.
The magic "does not get instantiated when false" feature of if-constexpr only
applies to the body of the else branch, not to the actual condition being
tested.
When you have a nested constexpr-if the some_fn(t) expression only occurs
inside the body, where it's valid. If it occurs in the condition, it still gets
instantiated.