Bug 102258 - [Parser] [Index] [F3] [F2] TargetRTS failure case for parser features
Summary: [Parser] [Index] [F3] [F2] TargetRTS failure case for parser features
Status: RESOLVED FIXED
Alias: None
Product: CDT
Classification: Tools
Component: cdt-core (show other bugs)
Version: 3.0   Edit
Hardware: PC Windows XP
: P3 normal (vote)
Target Milestone: 3.0   Edit
Assignee: Andrew Niefer CLA
QA Contact:
URL:
Whiteboard:
Keywords: contributed
Depends on:
Blocks:
 
Reported: 2005-06-29 23:18 EDT by John Camelon CLA
Modified: 2008-06-18 19:17 EDT (History)
1 user (show)

See Also:


Attachments
fix for this PR (1.55 KB, patch)
2005-06-30 10:02 EDT, Devin Steffler CLA
bjorn.freeman-benson: iplog+
Details | Diff
fix for this PR (1.42 KB, application/x-zip-compressed)
2005-07-05 11:39 EDT, Devin Steffler CLA
bjorn.freeman-benson: iplog+
Details

Note You need to log in before you can comment on or make changes to this bug.
Description John Camelon CLA 2005-06-29 23:19:07 EDT
Found testing RC1 candidate.  Not sure what's failing here, there may be more
than one thing wrong. 

1.  Load in TargetRTS project and index using the Full Indexer.
2.  Goto include/RTBindingEnd.h and select the struct specifier name (RTBindingEnd).
3.  Ctrl-Shift-G Search for all references finds none.
4.  File Search shows us this class if forward declared and used in other files.  

5.  Similarly, go to include/RTProtocol.h, see the forward reference to struct
RTBindingEnd.
6.  Ctrl-Shift-G Search for all references finds the 2 references within that file.
7.  Goto one of the references and hit F2 and no definition was found.
8.  Goto the same reference and hit F3 and you will goto the forward declaration.
Comment 1 Devin Steffler CLA 2005-06-30 10:02:00 EDT
Created attachment 24210 [details]
fix for this PR

Andrew, can you take a look at this patch?  The problem is with
DOMSearchUtil#createSearchFor(IBinding).

If an ICompositeType#getKey() is ICompositeType.k_struct then should ONLY
structs be searched for instead of classes and structs?  If this is the case
then how will you know when to search for a class/struct/union because
ICompositeType only has k_struct and k_union?

Should the code look like this:
		switch(((ICompositeType)binding).getKey()) {
		case ICompositeType.k_struct:
		    searchFor = ICSearchConstants.STRUCT;
		    break;
		case ICompositeType.k_union:
		    searchFor = ICSearchConstants.UNION;
		    break;
		default:
		    searchFor = ICSearchConstants.CLASS; // or maybe
CLASS_STRUCT here?
		    break;
		}
Comment 2 Devin Steffler CLA 2005-06-30 10:50:39 EDT
Note 102328 as I think that it is the same bug as this one but caused from a 
Class Template instead.
Comment 3 Andrew Niefer CLA 2005-07-05 10:51:25 EDT
You need to add ICPPClassType.k_class to the switch since thats what c++ classes
will return (even when you get the key through ICompositeType)

I would suggest using ICSearchConstants.CLASS_STRUCT for both k_struct and
k_class since the following code compiles under GCC:
struct A;
class A{};

The default case should probably be CLASS_STRUCT, or even the less restrictive TYPE.
Comment 4 Devin Steffler CLA 2005-07-05 11:39:45 EDT
Created attachment 24350 [details]
fix for this PR
Comment 5 Devin Steffler CLA 2005-07-05 13:12:53 EDT
Please take a look at the attached patch and apply/reject it.
Comment 6 Andrew Niefer CLA 2005-07-05 15:15:17 EDT
applied.