On 10/26/2011 10:35 PM, Paolo Carlini wrote:
On 10/26/2011 10:30 PM, Paolo Carlini wrote:
Hi,
At a glance, it looks too early; it's valid to have namespace-qualified names after ->.

namespace A
{
  struct B
  {
    int i;
  };
};

A::B* b;
int i = b->A::B::i;
I was also trying to construct such kind of example myself... but my patch does not regress on the testcase you wrote down. I can tell you exactly why, if you like..
We have that parser->scope is a RECORD_TYPE and postfix_expression is an INDIRECT_REF.
In this case, for example (like PR50870):

namespace impl
{
  struct inner
  {
    template <class T> T create();
  };
}

template <class T, class U, __SIZE_TYPE__
      = sizeof(impl::inner::create<T>() -> impl::inner::create<U>())>
struct foo;

we are also Ok, code is accepted, because name is a BASELINK and the new check isn't even reached (postfix_expression would be an ARROW_EXPR, but parser->scope again a RECORD_TYPE. More generally, in all the legal tests I tried by hand (outside the testsuite), when we get there parser->scope is always a RECORD_TYPE)

But if you feel more comfortable about performing the check elsewhere, I can try that of course.

Paolo.

Reply via email to