diff options
Diffstat (limited to 'gcc-4.9/gcc/testsuite/g++.dg/overload/template4.C')
-rw-r--r-- | gcc-4.9/gcc/testsuite/g++.dg/overload/template4.C | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/gcc-4.9/gcc/testsuite/g++.dg/overload/template4.C b/gcc-4.9/gcc/testsuite/g++.dg/overload/template4.C new file mode 100644 index 000000000..8f00d4171 --- /dev/null +++ b/gcc-4.9/gcc/testsuite/g++.dg/overload/template4.C @@ -0,0 +1,24 @@ +// PR c++/35986 +// { dg-do compile } + +namespace +{ + template <int> void foo (...); // { dg-message "foo" } + template <int> void bar (int, ...); // { dg-message "bar" } + void baz (...); // { dg-message "baz" } +} + +template <int> void foo (...); // { dg-message "note" } +template <int> void bar (int, ...); // { dg-message "note" } +void baz (...); // { dg-message "note" } + +void +test () +{ + foo <0> (0); // { dg-error "is ambiguous" } + // { dg-message "candidate" "candidate note" { target *-*-* } 18 } + bar <1> (0, 1); // { dg-error "is ambiguous" } + // { dg-message "candidate" "candidate note" { target *-*-* } 20 } + baz (0); // { dg-error "is ambiguous" } + // { dg-message "candidate" "candidate note" { target *-*-* } 22 } +} |