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

Bug 334472

Summary: Template resolution problem with function template arguments
Product: [Tools] CDT Reporter: Sergey Prigogin <eclipse.sprigogin>
Component: cdt-parserAssignee: Markus Schorn <mschorn.eclipse>
Status: RESOLVED FIXED QA Contact: Markus Schorn <mschorn.eclipse>
Severity: normal    
Priority: P3 CC: cdtdoug, marc.khouzam, yevshif
Version: 8.0   
Target Milestone: 8.1.2   
Hardware: PC   
OS: All   
Whiteboard:

Description Sergey Prigogin CLA 2011-01-16 01:25:17 EST
template <typename T>
class M {};

template<typename U>
U F();

template <M<int> (*Func)()>
struct G {
  M<int> operator()();
};

template <typename U>
struct H : public G<F<U> > {};

H<M<int> > C;

template <typename T>
void P(M<T> a);

void test() {
  P(C()); // Problem on P
}

The problem goes away when H<M<int> > C; is replaced by G<F<M<int> > > C; or when M<int> operator()(); is moved from G to H.
Comment 2 Markus Schorn CLA 2011-02-02 08:42:47 EST
The underlying issue is the same as for bug 299911. We need to model and store dependent expressions, for later instantiation. 

The template argument 'F<U>' for the base class G<F<U> > is the dependent expression that we currently cannot model.
Comment 3 Sergey Prigogin CLA 2012-06-28 20:45:55 EDT
Fixed by Markus' changes for bug 299911.