diff options
| author | Roman Divacky <rdivacky@FreeBSD.org> | 2009-10-14 18:03:49 +0000 |
|---|---|---|
| committer | Roman Divacky <rdivacky@FreeBSD.org> | 2009-10-14 18:03:49 +0000 |
| commit | 4c8b24812ddcd1dedaca343a6d4e76f91f398981 (patch) | |
| tree | 137ebebcae16fb0ce7ab4af456992bbd8d22fced /test/SemaCXX/addr-of-overloaded-function.cpp | |
| parent | 5362a71c02e7d448a8ce98cf00c47e353fba5d04 (diff) | |
Notes
Diffstat (limited to 'test/SemaCXX/addr-of-overloaded-function.cpp')
| -rw-r--r-- | test/SemaCXX/addr-of-overloaded-function.cpp | 27 |
1 files changed, 27 insertions, 0 deletions
diff --git a/test/SemaCXX/addr-of-overloaded-function.cpp b/test/SemaCXX/addr-of-overloaded-function.cpp index 9c9f0e19ef3c..80ea02bafd41 100644 --- a/test/SemaCXX/addr-of-overloaded-function.cpp +++ b/test/SemaCXX/addr-of-overloaded-function.cpp @@ -23,7 +23,34 @@ int g1(char); int g2(int); int g2(double); +template<typename T> T g3(T); +int g3(int); +int g3(char); + void g_test() { g(g1); g(g2); // expected-error{{call to 'g' is ambiguous; candidates are:}} + g(g3); } + +template<typename T> T h1(T); +template<typename R, typename A1> R h1(A1); +int h1(char); + +void ha(int (*fp)(int)); +void hb(int (*fp)(double)); + +void h_test() { + ha(h1); + hb(h1); +} + +struct A { }; +void f(void (*)(A *)); + +struct B +{ + void g() { f(d); } + void d(void *); + static void d(A *); +}; |
