[Bug c++/104691] SFINAE does not disable static_assert

2023-02-18 Thread cvs-commit at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=104691 --- Comment #6 from CVS Commits --- The trunk branch has been updated by Jason Merrill : https://gcc.gnu.org/g:9944ca17c0766623bce260684edc614def7ea761 commit r13-6133-g9944ca17c0766623bce260684edc614def7ea761 Author: Jason Merrill Date: Fr

[Bug c++/104691] SFINAE does not disable static_assert

2022-02-25 Thread redi at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=104691 --- Comment #5 from Jonathan Wakely --- N.B. this has nothing to do with SFINAE. The static_assert fails when the template is first parsed *not* when instantiated. You can verify this easily: template typename T::bar f(T) { static_assert(false,

[Bug c++/104691] SFINAE does not disable static_assert

2022-02-25 Thread redi at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=104691 --- Comment #4 from Jonathan Wakely --- Reduced: template typename T::foo f(T) { } template typename T::bar f(T) { static_assert(false, ""); } struct X { using foo = void; }; int main() { X x; f(x); } All compilers reject this code. S

[Bug c++/104691] SFINAE does not disable static_assert

2022-02-25 Thread redi at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=104691 Jonathan Wakely changed: What|Removed |Added Resolution|--- |INVALID Status|UNCONFIRME

[Bug c++/104691] SFINAE does not disable static_assert

2022-02-25 Thread pinskia at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=104691 --- Comment #2 from Andrew Pinski --- The unincluded source: #include #include #include template std::enable_if_t MakeFilled(const typename std::remove_reference::type & value) { TContainer result{}; std::fill(result.begin(), result.end

[Bug c++/104691] SFINAE does not disable static_assert

2022-02-25 Thread github at quantconsulting dot com via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=104691 --- Comment #1 from Leengit --- Closely related bug: although not demonstrated in the supplied code, note that compilation should complete successfully even if the static_assert fails to compile because its first argument is not `constexpr` give