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

Bug 363743

Summary: "Invalid template arguments" with pointer to member function default parameter
Product: [Tools] CDT Reporter: vagran <vagran.ast>
Component: cdt-parserAssignee: Markus Schorn <mschorn.eclipse>
Status: RESOLVED FIXED QA Contact: Markus Schorn <mschorn.eclipse>
Severity: normal    
Priority: P3 CC: cdtdoug, vagran.ast
Version: 8.1.0   
Target Milestone: 8.1.0   
Hardware: PC   
OS: Linux   
Whiteboard:

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