1 // PR c++/86946, DR 1321
2 // { dg-do compile { target c++11 } }
3 
4 int d(int, int);
5 template <long> class e {};
6 template <unsigned long f, unsigned b, typename> e<sizeof(d(f, b))> d();
7 template <unsigned long f, unsigned b, typename> e<d(f, b)> d();
8 
d2(T,U)9 template <class T, class U> constexpr T d2(T, U) { return 42; }
10 template <unsigned long f, unsigned b, typename> e<d2(f, b)> d2();
11 template <unsigned long f, unsigned b, typename> e<d2(f, b)> d2();
12 
13 template <typename a, typename c> a d3(a, c);
14 template <unsigned long f, unsigned b, typename> e<sizeof(d3(f, b))> d3();
15 template <unsigned long f, unsigned b, typename> e<sizeof(d3(f, b))> d3();
16 
17 
main()18 int main()
19 {
20   d<1,2,int>();
21   d2<1,2,int>();
22   d3<1,2,int>();
23 }
24