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

            Bug ID: 110030
           Summary: recursive template leads to long compilation time
           Product: gcc
           Version: 12.1.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c++
          Assignee: unassigned at gcc dot gnu.org
          Reporter: stevenxia990430 at gmail dot com
  Target Milestone: ---

The following invalid program is very slow to compile (>40 seconds) and return
error. Compared to clang which can quickly reject the program. Tested on gcc
trunk.

To quickly reproduce: https://gcc.godbolt.org/z/TeP69vrne
```
#include <tuple>

template<typename... Args>
    auto take_arguments(Args &&...args) {
        return take_arguments(std::index_sequence_for<Args...>{},
                                std::forward<Args>(args)...);
}

auto bytes_as_string(const BytesView &input) {
        return call_fun(&std::string::append, take_arguments(input));
}

int main(){
}
```

Reply via email to