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

            Bug ID: 96555
           Summary: "template argument involves template parameter(s)"
                    with dot or arrow operator in partial specialization
           Product: gcc
           Version: 11.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c++
          Assignee: unassigned at gcc dot gnu.org
          Reporter: arthur.j.odwyer at gmail dot com
  Target Milestone: ---

// https://godbolt.org/z/Kc98ea
struct A { int x; };
extern A a;
template<int...> struct B {};
template<int y>
struct B<y, sizeof(a.x)> {};


<source>:5:8: error: template argument '(int)sizeof (a.x)' involves template
parameter(s)
    5 | struct B<y, sizeof(a.x)> {};
      |        ^~~~~~~~~~~~~~~~~


GCC seems to have a problem only with expressions involving the dot operator
(e.g. `sizeof(a.x)`) and the arrow operator (e.g. `sizeof(p->x)`), but not any
other operators, which leads me to believe that the root cause here is related
to the root cause of bug 96215.

Grepbait: template argument involves template parameters

Same error message in different situations, all involving partial
specializations but none involving dot or arrow specifically: bug 67593, bug
83426, bug 90099

Reply via email to