Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.

Bug 338895

Summary: IName returns wrong starting line number
Product: [Tools] CDT Reporter: Lukas Felber <l.felber>
Component: cdt-indexerAssignee: Project Inbox <cdt-indexer-inbox>
Status: RESOLVED INVALID QA Contact: Markus Schorn <mschorn.eclipse>
Severity: normal    
Priority: P3 CC: cdtdoug
Version: 8.0   
Target Milestone: ---   
Hardware: PC   
OS: Linux   
Whiteboard:

Description Lukas Felber CLA 2011-03-04 03:10:12 EST
Build Identifier: M20100909-0800

When resolving the usage of a namespace alias with the indexer, the returned IName returns 0 for getStartingLineNumber (which is wrong, see code below).

Reproducible: Always

Steps to Reproduce:
1. create project with 2 files:
//main.cpp
#include "ns.h"
int main() {
	NS::i = 5;
	return 0;
}

//ns.h
namespace NS1 { int i = 1; }
namespace NS = NS1;

2. use index to resolve "NS" occurence in the main file (which returns 1 IName)
3. calling getFileLocation().getStartingLineNumber() on that name returns 0 but should be 2
Comment 1 Markus Schorn CLA 2011-03-09 08:11:11 EST
Works as specified, see javadoc of IASTFileLocation.getStartingLineNumber().
Comment 2 Lukas Felber CLA 2011-03-10 01:51:43 EST
(In reply to comment #1)
> Works as specified, see javadoc of IASTFileLocation.getStartingLineNumber().

that is true. is there a special reason that the line number is not remembered in the index? would it be possible to change that one gets the correct line number also form index file locations?