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

            Bug ID: 128540
           Summary: internal compiler error (while printing a diagnostic):
                    tree check ... at cp/cxx-pretty-print.cc
           Product: gcc
           Version: 17.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c++
          Assignee: unassigned at gcc dot gnu.org
          Reporter: 0599jiangyc at gmail dot com
  Target Milestone: ---

The following code:
```cpp
template<auto ns>
void f ()
{
  namespace j = [:ns:];
  int j = 0;
}
```

Resulted in this output:
```
<source>:5:7: error: 'int j' redeclared as different kind of entity
[-Wtemplate-body]
tree check: expected tree that contains 'decl minimal' structure, have
'splice_expr' in pp_cxx_namespace_alias_definition, at
cp/cxx-pretty-print.cc:2301
```

Trunk reproducer (`-std=c++26 -freflection`): https://godbolt.org/z/rn7fvaY93

Reply via email to