r209511 - PR19352 - getLocation() points to the wrong position for FriendDecls

Abramo Bagnara abramo.bagnara at bugseng.com
Fri Aug 29 23:43:46 PDT 2014


Il 30/08/2014 03:02, Nikola Smiljanic ha scritto:
>     > This seems wrong to me.
>     >
>     > Did you mean to write getLocEnd() instead? (Under the assumption that
>     > identifier should comes last in class type)
> 
>  
> This was done so that 'friend struct A' and 'friend A' (C++11) have
> different location since former is also a forward declaration. Does that
> make sense or have I misunderstood your question?

AFAIK this is not correct: getLocation() should always return the
location of identifier token.

> 
>     It is useful to know that currently for:
> 
>     template <class U> class C {
>       template<class T> friend struct A<T>::B;
>     };
> 
> 
> Not really sure what A is supposed to be here but this code is
> ill-formed: explicit specialization of non-template struct 'A'

This was only the part containing shown location, full code is

template <class T> struct A
{
  struct B { };
};

template <class U> class C {
  template <class T> friend struct A<T>::B;
};


-- 
Abramo Bagnara

BUGSENG srl - http://bugseng.com
mailto:abramo.bagnara at bugseng.com



More information about the cfe-commits mailing list