Bug 173874 - CPPClassType returns duplicate nested classes
Summary: CPPClassType returns duplicate nested classes
Status: RESOLVED FIXED
Alias: None
Product: CDT
Classification: Tools
Component: cdt-core (show other bugs)
Version: 4.0   Edit
Hardware: PC Windows XP
: P3 normal (vote)
Target Milestone: 4.0 M5   Edit
Assignee: Doug Schaefer CLA
QA Contact:
URL:
Whiteboard:
Keywords: contributed
Depends on:
Blocks:
 
Reported: 2007-02-12 10:22 EST by Bryan Wilkinson CLA
Modified: 2008-06-20 10:58 EDT (History)
0 users

See Also:


Attachments
proposed patch (1.92 KB, patch)
2007-02-12 10:35 EST, Bryan Wilkinson CLA
bjorn.freeman-benson: iplog+
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Bryan Wilkinson CLA 2007-02-12 10:22:06 EST
CPPClassType.getNestedClasses() often returns the same nested class multiple times.

Example:

class aClass {
  class bClass;
  int x;
};

In this case, getNestedClasses() would return a list containing two identical bindings for bClass.
Comment 1 Bryan Wilkinson CLA 2007-02-12 10:35:02 EST
Created attachment 58775 [details]
proposed patch

Fixes CPPClassType.getNestedClasses()

A variable was not being set back to null after each iteration of a loop going through each of the declarations within the class.
Comment 2 Doug Schaefer CLA 2007-02-14 11:17:05 EST
It is wild how many day one bugs you're finding. Thanks!
Comment 3 Doug Schaefer CLA 2007-02-14 11:19:39 EST
Patch applied. Feel free to contribute JUnit tests as well ;). I have written one for this bug in CompleteParser2Tests.