view gcc/testsuite/g++.dg/template/scope6.C @ 145:1830386684a0

gcc-9.2.0
author anatofuz
date Thu, 13 Feb 2020 11:34:05 +0900
parents
children
line wrap: on
line source

// PR c++/89831

struct Q { 
    int operator[](int i) { return 0; }
    int operator[](int i) const { return 0; }
};

struct Base {
    Q x;
};
struct X : public Base {
    template <typename T>
    void f(T) const {
        int q = Base::x[0];
    }   
};
int main() { X().f(3); }