decl2.C revision 1.1.1.1
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 10template <typename T> class bar; 11template <> struct bar<const char*> { typedef void type; }; 12template <typename T> class qux; 13template <> struct qux<int> { typedef void type; }; 14 15template <typename T> 16typename bar<T>::type foo (T t) { } 17 18template <typename T> 19typename qux<T>::type foo (T t) { } 20 21 22int 23main (int argc, char *argv[]) 24{ 25 foo ("foo"); 26 foo (7); 27} 28