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

            Bug ID: 102300
           Summary: Qualified name in class template
           Product: gcc
           Version: 11.2.1
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c++
          Assignee: unassigned at gcc dot gnu.org
          Reporter: huangqinjin at gmail dot com
  Target Milestone: ---

template<typename T>
struct holder
{
    template<typename F> struct fn {};

    struct t1 : fn<T> {};                      // pass
    struct t2 : holder<T >::fn<T> {};          // fail
    struct t3 : holder<T >::template fn<T> {}; // fail
    struct t4 : holder<T*>::template fn<T> {}; // pass
};

The code compiles with GCC 10 but not GCC 11.

Output of x86-64 gcc 11.1 (Compiler #2)
<source>:7:35: error: expected class-name before '{' token
    7 |     struct t2 : holder<T >::fn<T> {};          // fail
      |                                   ^
<source>:8:44: error: expected class-name before '{' token
    8 |     struct t3 : holder<T >::template fn<T> {}; // fail
      |         


https://godbolt.org/z/qMav3YrYK

Reply via email to