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

--- Comment #1 from Marek Polacek <mpolacek at gcc dot gnu.org> ---
And a related crash:

```
namespace N { template<class> struct X {}; }
template<template<class> class> struct S {};

template<auto ns>
void h () {
  namespace A = [:ns:];
  S<A::template X> s1;
}
void g () { h<^^N>(); }
```

w2.C: In function ‘void h()’:
w2.C:7:17: internal compiler error: tree check: expected class ‘type’, have
‘declaration’ (namespace_decl) in dependent_type_p, at cp/pt.cc:29908
    7 |   S<A::template X> s1;
      |                 ^
0x352d086 internal_error(char const*, ...)
        /home/mpolacek/src/gcc/gcc/diagnostic-global-context.cc:787
0x179394f tree_class_check_failed(tree_node const*, tree_code_class, char
const*, int, char const*)
        /home/mpolacek/src/gcc/gcc/tree.cc:9291
0x4021a3 tree_class_check(tree_node*, tree_code_class, char const*, int, char
const*)
        /home/mpolacek/src/gcc/gcc/tree.h:3986
0x84caef dependent_type_p(tree_node*)
        /home/mpolacek/src/gcc/gcc/cp/pt.cc:29908
0x558502 make_unbound_class_template(tree_node*, tree_node*, tree_node*, int)
        /home/mpolacek/src/gcc/gcc/cp/decl.cc:5214
0x75afdd cp_parser_lookup_name
        /home/mpolacek/src/gcc/gcc/cp/parser.cc:35630

Reply via email to