Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [cdt-dev] name resolution and index bindings

Hi Sergey,

I know this thread is more than a year old, but I'm resurrecting it because I'd like to finish fixing bug 402498.

>> [H]ow should declaredBefore() determine where 
>> [an index binding] was declared? 
>  
> It should be possible to improve declaredBefore by checking if the  
> index binding is declared in any of the included headers (see  
> CPPSemantics.isReachableFromAst(IASTTranslationUnit, IBinding)) and, if  
> not, using IASTTranslationUnit.getDeclarationsInAST(IBinding) to get  
> declarations in the current translation unit. 

Why is the second step necessary? I would think that checking if the index binding is declared in an included header is sufficient, because if the binding is in the current translation unit, we would have an AST binding instead of an index binding.

I have implemented just the first step (having declaredBefore() for an index binding check if it is declared in an included header), and I'm finding that it doesn't break any tests (but perhaps there's something I'm missing and that the tests don't catch).

Thanks,
Nate
 		 	   		  

Back to the top