Bug 95229 - [open declaration] infinite loop on keyword operator
Summary: [open declaration] infinite loop on keyword operator
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 M7   Edit
Assignee: Devin Steffler CLA
QA Contact:
URL:
Whiteboard:
Keywords: contributed
Depends on:
Blocks:
 
Reported: 2005-05-13 16:37 EDT by Devin Steffler CLA
Modified: 2009-01-09 16:57 EST (History)
2 users (show)

See Also:


Attachments
cdt_ui patch (872 bytes, patch)
2005-05-16 10:06 EDT, Devin Steffler CLA
bjorn.freeman-benson: iplog+
Details | Diff
cdt_ui_tests patch (1.80 KB, patch)
2005-05-16 10:06 EDT, Devin Steffler 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 Devin Steffler CLA 2005-05-13 16:37:51 EDT
struct A {
operator short(); // F3 on operator causes an infinite loop
} a;
int f(int);
int f(float);
int i = f(a); // Calls f(int), because short -> int is
// beeter than short -> float
Comment 1 Devin Steffler CLA 2005-05-16 10:06:00 EDT
Created attachment 21204 [details]
cdt_ui patch
Comment 2 Devin Steffler CLA 2005-05-16 10:06:18 EDT
Created attachment 21205 [details]
cdt_ui_tests patch
Comment 3 Devin Steffler CLA 2005-05-16 10:16:24 EDT
The example was taken from the C++ spec: 13.3.3.2-3c

I'm guessing "operator short()" is a conversion operator and that's why it's 
not listed as one of the overloaded operators in the C++ spec A.11?

Are there any other operator's that I should be aware of?

The patch attached to this PR should still be applied to fix this bug.

Note:  The Error in AutomatedSuite is also visible from CVS Head before this 
patch is applied.  "Problems encountered while deleting resources." and it is 
part of the ContentAssistRegressionTests.
Comment 4 Andrew Niefer CLA 2005-05-16 10:45:05 EDT
you can have conversions for any type.  So all the basic types: void, bool,
char, w_chart, int, float, double, along with the modifiers short, long, long
long, signed, unsigned.  And user defined types (classes, typedefs, enums). 
Along with pointers, member pointers, reference, arrays.
Comment 5 Devin Steffler CLA 2005-05-16 10:48:29 EDT
Can you give me an example of: "Along with pointers, member pointers, 
reference, arrays." ?  Is it something other than the overloaded operators in 
A.11?
Comment 6 Andrew Niefer CLA 2005-05-16 11:11:28 EDT
Conversion functions are different from operator overloads, so that list of
operators has nothing to do with this.
Look at the grammar in the grammar summary A.10
conversion-function-id: operator conversion-type-id
coversion-type-id:  type-specifier-seq conversion-declaratoropt
conversion-declarator : ptr-operator conversion-declaratoropt

(I was wrong about arrays being in there)
ex:
operator int *
operator signed char * volatile &
operator const bool ::A*
Comment 7 Devin Steffler CLA 2005-05-17 08:57:05 EDT
Patch applied to HEAD.