sdkrystian wrote: > > @mizvekov Without unannotated tentative parsing (to be _properly_ > > introduced by #96364), issuing a warning is infeasible. Either way, by the > > time we detect the error we could be who knows how deep into the second > > operand of a `>` operator. > > So when we are parsing `this->A`. Suppose what follows it looks like a > template argument list. Then we see if `this->template A` would have found a > template. if it does find the template `A`, we issue the warning and proceed > as if the user had written `this->template A` > > Do you think that's workable?
We already do that :) the problem is when what follows `A` _doesn't_ unambiguously look like a template argument list: ``cpp int x = 0; template<int I> struct f { }; template<typename T> void g(T t) { t.f<0>::x; // could be interpreted as '((t.f) < 0) > (::x)' } ``` https://github.com/llvm/llvm-project/pull/98547 _______________________________________________ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits