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

            Bug ID: 102038
           Summary: another case of template function signature
                    incorrectly dropping top-level cv-qualifier with
                    function parameter of decltype from qualified-id of
                    array member variable of template class
           Product: gcc
           Version: 10.2.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c++
          Assignee: unassigned at gcc dot gnu.org
          Reporter: nickhuang99 at hotmail dot com
  Target Milestone: ---

This is a similar case of PR101402,PR102033,PR102034

template<decltype(sizeof(int)) N>
struct A{
        template<class TB>
        struct B{
                using TB_Alias=TB;
                template<class TC=TB_Alias>
                struct C{
                        typedef TC Arr[N];
                        Arr arr;
                };
        };
};
template<decltype(sizeof(int)) N, class TB>
void f(const decltype(A<N>::template B<TB>::template C<>::arr)){}

template<>void f<3, char>(const char [3]){}



I provide this similar bug of PR101402,PR102033,PR102034 in a purpose to expose
more aspect of this issue when using decltype-type, possibly as a future test
case when this "family" of bugs being fixed. More importantly, just a slightly
different of above case is passed by GCC when we are using "reference of array"
which is very interesting for developer to dig.

This passed!


template<decltype(sizeof(int)) N>
struct A{
        template<class TB>
        struct B{
                using TB_Alias=TB;
                template<class TC=TB_Alias>
                struct C{
                        typedef TC Arr[N];
                        Arr arr;
                };
        };
};
template<decltype(sizeof(int)) N, class TB>
void f(const decltype(A<N>::template B<TB>::template C<>::arr) &){}

template<>void f<3, char>(char const(&)[3]){}

Reply via email to