This commit was manufactured by cvs2svn to create branch
[official-gcc.git] / gcc / testsuite / g++.dg / template / sfinae1.C
blob47db4115452a4418861175dad4654d29d1e5d424
1 // PR c++/14337
3 template <bool> struct Constraint; 
4 template <>     struct Constraint<true> { typedef int Result; }; 
5  
6 template <typename T> 
7 struct IsInt      { static const bool value = false; }; 
8  
9 template <> 
10 struct IsInt<int> { static const bool value = true; }; 
12 template <typename T> 
13 typename Constraint<IsInt<T>::value>::Result foo(T); 
15 template <typename T> 
16 typename Constraint<!IsInt<T>::value>::Result foo(T); 
18 template <typename> 
19 void bar() { 
20     foo(1); 
21