gcc/testsuite/g++.old-deja/g++.pt/ref4.C
raw| 1 | // { dg-do assemble } |
| 2 | // { dg-prune-output "mangled name" } |
| 3 | // |
| 4 | // Copyright (C) 2001 Free Software Foundation, Inc. |
| 5 | // Contributed by Nathan Sidwell 29 Apr 2001 <[email protected]> |
| 6 | |
| 7 | // Bug 2664. We failed to convert_from_reference for non-type |
| 8 | // template parms. |
| 9 | |
| 10 | struct cow { }; |
| 11 | |
| 12 | cow c; |
| 13 | |
| 14 | void func (cow &c) {} |
| 15 | void operator-(cow &c) {} |
| 16 | |
| 17 | template<cow &C> void test() |
| 18 | { |
| 19 | func(C); //OK |
| 20 | -C; //bogus error |
| 21 | } |
| 22 | |
| 23 | int main() |
| 24 | { |
| 25 | test<c> (); |
| 26 | } |