Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 344310 - Invalid overload using function pointer
Summary: Invalid overload using function pointer
Status: RESOLVED FIXED
Alias: None
Product: CDT
Classification: Tools
Component: cdt-parser (show other bugs)
Version: 8.0   Edit
Hardware: All All
: P3 normal (vote)
Target Milestone: 8.0   Edit
Assignee: Markus Schorn CLA
QA Contact: Markus Schorn CLA
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2011-04-29 12:26 EDT by Marc-André Laperle CLA
Modified: 2011-05-02 18:35 EDT (History)
1 user (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
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.