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

            Bug ID: 112795
           Summary: [C++>=14] ICE pragma GCC unroll (n)
                    cxx_eval_constant_expression
           Product: gcc
           Version: 8.1.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c++
          Assignee: unassigned at gcc dot gnu.org
          Reporter: magnus.hegdahl at gmail dot com
  Target Milestone: ---

Compiling the following code with GCC >= 8.1 (when #pragma GCC unroll was
added), and -std=c++14 or higher results in an internal compiler error:
```
constexpr int n = 1;
template <class = void>
void f() {
#pragma GCC unroll(n)
    for (int i = 0; i != n; ++i) {
    }
}
```

It does not fail if f is not a template, if n is not parenthesized, or if using
-std=c++11.

Reply via email to