gcc/testsuite/g++.dg/overload/operator-star-1.C
raw| 1 | // Copyright (C) 2002 Free Software Foundation |
| 2 | // Origin: C++/70 |
| 3 | // Contributed by Gabriel Dos Reis <[email protected]> |
| 4 | // { dg-do compile } |
| 5 | |
| 6 | template <class T> |
| 7 | struct S; |
| 8 | |
| 9 | template <class T> |
| 10 | void operator* (S<T>, S<T>); |
| 11 | |
| 12 | template <class T> |
| 13 | struct S |
| 14 | { |
| 15 | friend void operator*<> (S, S); // { } // okay |
| 16 | void operator* (T) { } |
| 17 | }; |
| 18 | |
| 19 | template <class T> |
| 20 | void operator* (S<T>, S<T>) { } |
| 21 | |
| 22 | int main() |
| 23 | { |
| 24 | S<int> s1, s2; |
| 25 | s1 * s2; |
| 26 | s1 * 2; |
| 27 | } |