1 // Copyright (C) 1999 Free Software Foundation, Inc.
2 // Contributed by Nathan Sidwell 21 Nov 1999 <nathan@acm.org>
4 // make sure __FUNCTION__ and __PRETTY_FUNCTION__ work in templates
9 static bool bad = false;
11 template<class T> void f1 (T)
13 char const *function = __FUNCTION__;
14 char const *pretty = __PRETTY_FUNCTION__;
17 printf ("__FUNCTION__ %s\n", function);
18 printf ("__PRETTY_FUNCTION__ %s\n", pretty);
20 if (strcmp (function, "f1"))
22 if (strcmp (pretty, "void f1(T) [with T = float]")) // only for float instantiation
26 template<> void f1<int> (int)
28 char const *function = __FUNCTION__;
29 char const *pretty = __PRETTY_FUNCTION__;
31 printf ("specialized\n");
32 printf ("__FUNCTION__ %s\n", function);
33 printf ("__PRETTY_FUNCTION__ %s\n", pretty);
35 if (strcmp (function, "f1"))
37 if (strcmp (pretty, "void f1(T) [with T = int]"))
44 f1(0.0f); // f1<float>