Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 334472 - Template resolution problem with function template arguments
Summary: Template resolution problem with function template arguments
Status: RESOLVED FIXED
Alias: None
Product: CDT
Classification: Tools
Component: cdt-parser (show other bugs)
Version: 8.0   Edit
Hardware: PC All
: P3 normal (vote)
Target Milestone: 8.1.2   Edit
Assignee: Markus Schorn CLA
QA Contact: Markus Schorn CLA
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2011-01-16 01:25 EST by Sergey Prigogin CLA
Modified: 2013-01-31 12:39 EST (History)
3 users (show)

See Also:


Attachments

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