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

Bug 344310

Summary: Invalid overload using function pointer
Product: [Tools] CDT Reporter: Marc-André Laperle <malaperle>
Component: cdt-parserAssignee: Markus Schorn <mschorn.eclipse>
Status: RESOLVED FIXED QA Contact: Markus Schorn <mschorn.eclipse>
Severity: normal    
Priority: P3 CC: cdtdoug
Version: 8.0   
Target Milestone: 8.0   
Hardware: All   
OS: All   
Whiteboard:

Description Marc-André Laperle CLA 2011-04-29 12:26:29 EDT
Using CDT 8.0.0.201104290938

Sample code:

class Bar
{
public:
    template<typename T>
    Bar(void (T::*function)())
    {
    }
};

class Foo
{
public:
    void function() {}
    void function(int) {}
};

int main() {

    Bar test(&Foo::function); // Invalid overload of 'Foo::function'
	return 0;
}

This code compiles without warnings with GCC 4.4 and MSVC 9
Comment 1 Marc-André Laperle CLA 2011-04-30 14:00:00 EDT
Related to bug 85843 maybe?
Comment 2 Markus Schorn CLA 2011-05-02 09:39:11 EDT
Thanks for the sample code!
Fixed in 8.0 > 20110502.
Comment 4 Marc-André Laperle CLA 2011-05-02 18:35:51 EDT
Great thanks! It fixed the problem in my production code too.