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

            Bug ID: 98579
           Summary: ICE:  in output_constructor_regular_field, at
                    varasm.c:5491
           Product: gcc
           Version: unknown
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c++
          Assignee: unassigned at gcc dot gnu.org
          Reporter: sguelton at redhat dot com
  Target Milestone: ---

The following code 

```
#include <tuple>
struct ComplexPart;

template <typename PA, typename PB> struct FollowParser {
  constexpr FollowParser(PA pa, PB pb) : pa_{pa}, pb_{pb} {}
  const PA pa_;
  const PB pb_;
};
template <typename PA, typename PB>
inline constexpr FollowParser<PA, PB> operator/(PA pa, PB pb) {
  return FollowParser<PA, PB>{pa, pb};
}
template <typename... PARSER> struct ApplyConstructor {
  constexpr ApplyConstructor(PARSER... p) : parsers_{p...} {}
  const std::tuple<PARSER...> parsers_;
};
template <typename... PARSER>
constexpr ApplyConstructor<PARSER...> construct(PARSER... p) {
  return ApplyConstructor<PARSER...>{p...};
}
template <typename A> struct Parser {
  constexpr Parser() {}
};
auto tmp = construct(Parser<ComplexPart>{} / ",", Parser<ComplexPart>{});
```

compiled with

```
g++ -std=c++17 -c F.cpp
```

raises an ICE. Reproducer on godbolt, using trunk gcc:
https://gcc.godbolt.org/z/M3r15z

Possible duplicate: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=98463
but the example look different enough.

Reply via email to