[Bug c++/124926] [reflection] Cannot reflect on dependent class template

mpolacek at gcc dot gnu.org gcc-bugzilla@gcc.gnu.org
Wed Apr 22 13:05:53 GMT 2026


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

--- Comment #1 from Marek Polacek <mpolacek at gcc dot gnu.org> ---
This works with a static variable template:

```
template <typename>
struct Cls {
  template <typename> static constexpr int Inner = 42;
};

template <typename T>
constexpr auto r = ^^Cls<T>::template Inner;

constexpr auto s = r<int>;
```

because we create a SCOPE_REF for "Cls<T>::template Inner" which doesn't expand
to a TYPE_DECL here.


More information about the Gcc-bugs mailing list