[Bug c++/88628] lambda expression in static_assert in if constexpr is not evaluated

2018-12-28 Thread merukun1125 at docomo dot ne.jp
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=88628 --- Comment #9 from merukun1125 at docomo dot ne.jp --- Tn Comment 6, not #include struct S { // A type that does not depend on template parameter T auto operator()() const -> decltype(false) { return false; } }; template T ge

[Bug c++/88628] lambda expression in static_assert in if constexpr is not evaluated

2018-12-28 Thread merukun1125 at docomo dot ne.jp
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=88628 --- Comment #8 from merukun1125 at docomo dot ne.jp --- (In reply to Jakub Jelinek from comment #7) > http://eel.is/c++draft/expr.prim.lambda.closure says: > > The type of a lambda-expression (which is also the type of the closure > object) is a

[Bug c++/88628] lambda expression in static_assert in if constexpr is not evaluated

2018-12-28 Thread jakub at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=88628 --- Comment #7 from Jakub Jelinek --- http://eel.is/c++draft/expr.prim.lambda.closure says: The type of a lambda-expression (which is also the type of the closure object) is a unique, unnamed non-union class type, called the closure type, whose

[Bug c++/88628] lambda expression in static_assert in if constexpr is not evaluated

2018-12-28 Thread merukun1125 at docomo dot ne.jp
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=88628 merukun1125 at docomo dot ne.jp changed: What|Removed |Added Status|UNCONFIRMED |RESOLVED Resolu

[Bug c++/88628] lambda expression in static_assert in if constexpr is not evaluated

2018-12-28 Thread merukun1125 at docomo dot ne.jp
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=88628 --- Comment #5 from merukun1125 at docomo dot ne.jp --- (In reply to Jakub Jelinek from comment #4) > lambda is AFAIK a local class, so you need to instantiate it. So it is more > similar to: > #include > > template > constexpr bool run() { ret

[Bug c++/88628] lambda expression in static_assert in if constexpr is not evaluated

2018-12-28 Thread jakub at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=88628 --- Comment #4 from Jakub Jelinek --- lambda is AFAIK a local class, so you need to instantiate it. So it is more similar to: #include template constexpr bool run() { return false; } template T get() { struct S {}; if constexpr (std::

[Bug c++/88628] lambda expression in static_assert in if constexpr is not evaluated

2018-12-28 Thread merukun1125 at docomo dot ne.jp
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=88628 --- Comment #3 from merukun1125 at docomo dot ne.jp --- (In reply to Jakub Jelinek from comment #2) > clang++ agrees with g++ here. The lambda expression needs to be > instantiated so that it can be evaluated and expressions in discarded > statem

[Bug c++/88628] lambda expression in static_assert in if constexpr is not evaluated

2018-12-28 Thread jakub at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=88628 --- Comment #2 from Jakub Jelinek --- clang++ agrees with g++ here. The lambda expression needs to be instantiated so that it can be evaluated and expressions in discarded statements are not instantiated.

[Bug c++/88628] lambda expression in static_assert in if constexpr is not evaluated

2018-12-28 Thread jakub at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=88628 Jakub Jelinek changed: What|Removed |Added CC||jakub at gcc dot gnu.org --- Comment #1