OSDN Git Service

* gcc.dg/tm/memopt-6.c: Cleanup tmedge tree dump.
[pf3gnuchains/gcc-fork.git] / gcc / testsuite / g++.dg / template / defarg5.C
1 // { dg-do compile }
2
3 // Origin: Ivan Godard <igodard@pacbell.net>
4 //         Wolfgang Bangerth <bangerth@dealii.org>
5
6 // PR c++/17344: Substitution failure is not an error
7 // for default template argument
8
9 template <class> struct intTraits; 
10  
11 template<> struct intTraits<int> { 
12     static const int i = 0; 
13 }; 
14  
15 template<typename E, E i = intTraits<E>::i> struct A {}; 
16  
17 struct S { 
18     template <template <typename> class X> S(X<void>); 
19 }; 
20  
21 int bar(S); 
22 int bar(A<int,0>); 
23  
24 A<int> bed; 
25 int i = bar(bed);