Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [cdt-dev] visibility of typedefs/type aliases

On Wednesday 12 Feb 2014 11:04:19 Sergey Prigogin wrote:
> I agree that typedefs require special treatment. Will you be willing to
> give it a shot?
I've been shooting already ;-) And that's why I was asking. The question is 
whether the code stated below is required, or if it is superfluous.
My first approach was to remove the check altogether, and in fact the typedefs 
started to work. But I don't know what might break by this change. First I 
thought it might be forward declarations but then I realized that those cannot 
be subject of this check. Do you have any hints what this check is good for 
(comments in the code would be a boon ;-)?

Michi
> 
> -sergey
> 
> On Wed, Feb 12, 2014 at 9:12 AM, scalpel4k <scalpel4k@xxxxxxxxx> wrote:
> > Hi,
> > 
> > I've run CDT with the debugger and found this check in
> > 
> > ClassTypeHelper.java (line 955ff)
> > 
> > ...
> > if (member instanceof IType &&
> > 
> >      memberBinding instanceof IType &&
> >      ((IType) member).isSameType((IType) memberBinding) )
> > 
> > {
> > 
> >         return visibility;
> > 
> > }
> > 
> > what this does in case of member == typedef or type alias, isSameType
> > check
> > returns the visibility of the underlying type. As far as I know this isn't
> > correct, at least not in C++11. A typedef can change the visibility of its
> > base type.
> > My question here is, are there any other situations where this check is
> > required? Otherwise typedefs have to be treated separately.
> > 
> > I ask this question with respect to
> > https://bugs.eclipse.org/bugs/show_bug.cgi?id=427730
> > where you can find a code example.
> > 
> > thx Michi
> > _______________________________________________
> > cdt-dev mailing list
> > cdt-dev@xxxxxxxxxxx
> > https://dev.eclipse.org/mailman/listinfo/cdt-dev


Back to the top