Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 363743 - "Invalid template arguments" with pointer to member function default parameter
Summary: "Invalid template arguments" with pointer to member function default parameter
Status: RESOLVED FIXED
Alias: None
Product: CDT
Classification: Tools
Component: cdt-parser (show other bugs)
Version: 8.1.0   Edit
Hardware: PC Linux
: P3 normal (vote)
Target Milestone: 8.1.0   Edit
Assignee: Markus Schorn CLA
QA Contact: Markus Schorn CLA
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2011-11-14 15:11 EST by vagran CLA
Modified: 2012-02-23 11:33 EST (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 vagran CLA 2011-11-14 15:11:28 EST
Build Identifier: 20110916-0149

Consider this code:

class A {
public:
    void SomeMethod() { }
};

template <class T, void (T::*SomeMethod)() = &T::SomeMethod>
class B {

};

B<A> b1; // <<< "Invalid template arguments" CDT parser error!

The code is valid in GCC 4.6.

Reproducible: Always

Steps to Reproduce:
Create code from Details in C++ CDT project.
"Invalid template arguments" error will be visible.
Comment 1 Markus Schorn CLA 2011-11-28 03:49:50 EST
Thanks for the example, added testcase and fix.
Comment 2 CDT Genie CLA 2011-11-28 04:23:02 EST
*** cdt git genie on behalf of Markus Schorn ***

    Bug 363743: Default arg for non-type template parameter.

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