Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 351609 - Problems with const template argument
Summary: Problems with const template argument
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.1   Edit
Assignee: Markus Schorn CLA
QA Contact: Markus Schorn CLA
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2011-07-08 16:33 EDT by Marc-André Laperle CLA
Modified: 2011-07-20 09:19 EDT (History)
2 users (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-07-08 16:33:39 EDT
Using CDT8.0.0.201107060210

template<typename Arg>
class Callback
{
public:
    Callback(void (*function)(Arg arg))
    {
    }
};

void Subscribe(const Callback<const int>& callback){}

void CallMe(const int){}

int main()
{
    Subscribe(Callback<const int>(&CallMe)); // invalid arguments, symbol not resolved, here
    return 0;
}

If I extract the callback to a variable then pass it to Subscribe, the problems disappear. If I replace 'const int' for 'int', the problems disappear.
Comment 1 Markus Schorn CLA 2011-07-20 08:09:26 EDT
Added testcase, fixed in 8.0.1 > 20110720.
Comment 2 CDT Genie CLA 2011-07-20 08:19:36 EDT
*** cdt git genie on behalf of 351609 ***

    Bug 351609: Adjust parameter types in instantiated function type.

[*] http://git.eclipse.org/c/cdt/org.eclipse.cdt.git/commit/?id=d226e960f9c1b40edd2dadefa005d092d1831fdf
Comment 3 CDT Genie CLA 2011-07-20 09:19:34 EDT
*** cdt git genie on behalf of 351609 ***

    Bug 351609: Adjust parameter types in instantiated function type.

[*] http://git.eclipse.org/c/cdt/org.eclipse.cdt.git/commit/?id=f05e59801e199a0b51c06ad0c348da062f7194dd