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

            Bug ID: 91377
           Summary: (regression) ICE with non-static block scope
                    constexpr, captured in lambda, used as template
                    parameter
           Product: gcc
           Version: 9.1.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c++
          Assignee: unassigned at gcc dot gnu.org
          Reporter: gcc.j.kelling at hzdr dot de
  Target Milestone: ---

Created attachment 46677
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=46677&action=edit
gcc 9.1.0 output (make.out) and prprocessed source (main.cpp)

The attached code (main.cpp) triggers an internal compiler error with gcc 9.1.0
but works with gcc 7.3.0.

./include/pmacc/particles/ParticlesBase.kernel:1334:32: internal compiler
error: in lookup_template_class_1, at cp/pt.c:9545
 1334 |                     DataSpace< dim > dstSuperCell = DataSpaceOperations
< dim - 1 > ::extend(
      |                                ^~~
(full message in make.out in attachment, line 221666 in preprocessed code)

The reported line is in the body of a lambda, passed to a function template.
The surrounding scope is the body of a function template, in which `dim` is
declared as constexpr in line 221564 in the preprocessed code. When adding
`static` to this constexpr declaration the code compiles in gcc 9.1.0.

I failed to produce a minimal example.

Reply via email to