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

            Bug ID: 110300
           Summary: Template disambiguator accepted for non-template
                    function
           Product: gcc
           Version: 13.1.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c++
          Assignee: unassigned at gcc dot gnu.org
          Reporter: csaba_22 at yahoo dot co.uk
  Target Milestone: ---

template <typename U>
struct Bar{
    void setNumber(int) {}
};

template <int N>
struct Asd : public Bar<Asd<N>>{
    void doSomething();
};

template<int N>
inline void Asd<N>::doSomething() {
    this->template setNumber(N);
}

int main() {
    Asd<42> obj;
    obj.doSomething();
}

(https://godbolt.org/z/xbs8GqG7h)

is accepted by GCC 13 and trunk, even though setNumber() is not a template
function.

https://stackoverflow.com/q/76500060/

Reply via email to