PR c++/86728 - C variadic generic lambda.
[official-gcc.git] / gcc / testsuite / g++.dg / template / spec26.C
blob3d187071afe1d9c2051405db19415ebfbbb08b6a
1 // dg-do run
2 // Copyright (C) 2005 Free Software Foundation, Inc.
3 // Contributed by Nathan Sidwell 16 Sep 2005 <nathan@codesourcery.com>
5 // PR 23519  template specialization ordering (DR214)
6 // Origin:  Maxim Yegorushkin <maxim.yegorushkin@gmail.com>
8 struct A
10     template<class T> int operator+(T&) { return 1;}
13 template<class T> struct B
15   int operator-(A&) {return 2;}
16   template<typename R> int operator*(R&) {return 3;}
19 template <typename T, typename R> int operator-(B<T>, R&) {return 4;}
20 template<class T> int operator+(A&, B<T>&) { return 5;}
21 template <typename T> int operator*(T &, A&){return 6;}
23 int main()
25   A a;
26   B<A> b;
27   if ((a + b) != 5)
28     return 1;
29   
30   if ((b - a) != 2)
31     return 2;
32   
33   if ((b * a) != 6)
34     return 3;