https://gcc.gnu.org/bugzilla/show_bug.cgi?id=111544
--- Comment #10 from Andrew Pinski <pinskia at gcc dot gnu.org> ---
(In reply to Andrew Pinski from comment #7)
> Actually this is the reduced testcase:
> ```
> struct bs
> {
>         int * const t;
> };
> template <int n>
> struct a
> {
>         int * const t;
>         a &f(const a&, int *const tt, const a *c, const bs&);
> };
> 
> template <int n>
> a<n> & a<n>::f(const a &b, int *const tt, const a *c, const bs &d)
> {
>         t = c->t;
>         t = b.t;
>         // t = d.t;
>         // t = tt;
>         return *this;
> }
> ```
> 
> clang accepts each of the above statements except for the commented out
> ones. Not even in pedantic mode they reject them.

Clang does reject it if it is instantiated:
```
void g(a<1> &a1, bs &d)
{
        a1.f(a1,nullptr,&a1, d);
}
```
So clang most likely thinks b.t and c->t are still type depedent even though
they don't need to be ...

Reply via email to