[Bug c++/116646] Compilation of code inside if constexpr with failed condition.

2024-09-09 Thread cas43 at cs dot stanford.edu via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=116646 --- Comment #4 from Craig Schroeder --- Thank you for taking the time to explain this. I understand why the code snippet does not work now.

[Bug c++/116646] Compilation of code inside if constexpr with failed condition.

2024-09-09 Thread redi at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=116646 --- Comment #3 from Jonathan Wakely --- (In reply to Andrew Pinski from comment #1) > I think since it is not dependent, it gets resolved right away. Right. A discarded statement (i.e. an untaken if-constexpr branch) is not instantiated in a te

[Bug c++/116646] Compilation of code inside if constexpr with failed condition.

2024-09-08 Thread pinskia at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=116646 Andrew Pinski changed: What|Removed |Added Resolution|--- |INVALID Status|UNCONFIRMED

[Bug c++/116646] Compilation of code inside if constexpr with failed condition.

2024-09-08 Thread pinskia at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=116646 --- Comment #1 from Andrew Pinski --- It works when y is dependent though: ``` template void f() { if constexpr(y<0) { static_assert(y<0); } } auto t = &f<0>; ``` I think since it is not dependent, it ge