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

Patrick Palka <ppalka at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
     Ever confirmed|0                           |1
         Resolution|FIXED                       |---
             Status|RESOLVED                    |NEW
   Last reconfirmed|                            |2025-04-07

--- Comment #5 from Patrick Palka <ppalka at gcc dot gnu.org> ---
Reopening as this is not fully fixed as Barry pointed out in PR117849#c12:

template <class T, int N>
struct Array {
    constexpr int size() const { return N; }
};

struct A {
    Array<int, 4> a;

    void f() {
        static_assert(a.size() == 4); // ok
    }        
};

struct B {
    Array<int, 4>* p;

    void f() {
        static_assert(p->size() == 4); // error (expected) 
    }    
};

struct C {
    Array<int, 4>& r;

    void f() {
        static_assert(r.size() == 4); // error (unexpected?)
    }
};

struct D {
    Array<int, 4>& r;

    void f() {
        Array<int, 4>& local = r;
        static_assert(local.size() == 4); // error (unexpected?)
    }
};

Reply via email to