Community
Participate
Working Groups
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
Created attachment 21204 [details] cdt_ui patch
Created attachment 21205 [details] cdt_ui_tests patch
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.
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.
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?
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*
Patch applied to HEAD.