[Bug c++/105304] New: ICE segfault using ad-hoc concept with -Wall

bjoern at hoehrmann dot de gcc-bugzilla@gcc.gnu.org
Mon Apr 18 16:14:20 GMT 2022


https://gcc.gnu.org/bugzilla/show_bug.cgi?id=105304

            Bug ID: 105304
           Summary: ICE segfault using ad-hoc concept with -Wall
           Product: gcc
           Version: 11.2.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c++
          Assignee: unassigned at gcc dot gnu.org
          Reporter: bjoern at hoehrmann dot de
  Target Milestone: ---

GCC 11.2.0 on Linux

 ❯  g++-11 -Wall -std=c++2a -o x ../mini.cxx   
../mini.cxx: In function 'int main()':
../mini.cxx:23:18: internal compiler error: Segmentation fault
   23 |                 }) {
      |                  ^
Please submit a full bug report,

Code:

#include <iostream>
#include <utility>

class X
{
public:
  int m(int, int, int = 7) { return 123; }
};

template<typename... Ts>
void
invoke_m(std::index_sequence_for<Ts...> is)
{
  X o;
  o.m(Ts()...);
}

int
main()
{
  if constexpr (requires {
                  invoke_m<int, int, int, int>(std::make_index_sequence<4>());
                }) {
    std::cerr << "ok" << '\n';
  }

  return 0;
}

Compiles when omitting -Wall.


More information about the Gcc-bugs mailing list