// PR c++/66092 // { dg-do compile { target c++17 } } // { dg-options "-fconcepts" } #include template requires (sizeof...(Args) == 0) constexpr decltype(auto) check() { return std::integral_constant(); } template requires (sizeof...(Args) > 0) constexpr decltype(auto) check() { return std::integral_constant())::value>(); } template concept Same = decltype(check())::value; template concept Similar = true; template requires Same() // { dg-error "" } void foo( Args... args ) {} template requires Similar // { dg-error "pack expansion" } void bar( Args... args ) {} int main() { foo(1, 2, 3); // { dg-error "" } bar(1, 2, 3); // { dg-error "" } }