1 // { dg-do compile } 2 3 // Copyright (C) 2002 Free Software Foundation, Inc. 4 // Contributed by Nathan Sidwell 24 Dec 2002 <nathan@codesourcery.com> 5 // Source Martin Buchholz martin@xemacs.org 6 7 // PR 9053. Failed to consider templates that are disambiguated by 8 // return type. 9 10 template <typename T> class bar; 11 template <> struct bar<const char*> { typedef void type; }; 12 template <typename T> class qux; 13 template <> struct qux<int> { typedef void type; }; 14 15 template <typename T> 16 typename bar<T>::type foo (T t) { } 17 18 template <typename T> 19 typename qux<T>::type foo (T t) { } 20 21 22 int 23 main (int argc, char *argv[]) 24 { 25 foo ("foo"); 26 foo (7); 27 } 28