Douglas Gregor | 7ad5d42 | 2010-11-09 21:07:58 +0000 | [diff] [blame] | 1 | // RUN: %clang_cc1 -fsyntax-only -verify %s |
| 2 | |
Douglas Gregor | db2eae6 | 2011-03-16 19:16:25 +0000 | [diff] [blame^] | 3 | int ovl(int); // expected-note 3{{candidate function}} |
| 4 | float ovl(float); // expected-note 3{{candidate function}} |
Douglas Gregor | 7ad5d42 | 2010-11-09 21:07:58 +0000 | [diff] [blame] | 5 | |
Douglas Gregor | db2eae6 | 2011-03-16 19:16:25 +0000 | [diff] [blame^] | 6 | template<typename T> T ovl(T); // expected-note 3{{candidate function}} |
Douglas Gregor | 7ad5d42 | 2010-11-09 21:07:58 +0000 | [diff] [blame] | 7 | |
| 8 | void test(bool b) { |
Douglas Gregor | db2eae6 | 2011-03-16 19:16:25 +0000 | [diff] [blame^] | 9 | (void)((void)0, ovl); // expected-error{{cannot resolve overloaded function 'ovl' from context}} |
Douglas Gregor | 7ad5d42 | 2010-11-09 21:07:58 +0000 | [diff] [blame] | 10 | // PR7863 |
Douglas Gregor | db2eae6 | 2011-03-16 19:16:25 +0000 | [diff] [blame^] | 11 | (void)(b? ovl : &ovl); // expected-error{{cannot resolve overloaded function 'ovl' from context}} |
| 12 | (void)(b? ovl<float> : &ovl); // expected-error{{cannot resolve overloaded function 'ovl' from context}} |
Douglas Gregor | 7ad5d42 | 2010-11-09 21:07:58 +0000 | [diff] [blame] | 13 | (void)(b? ovl<float> : ovl<float>); |
| 14 | } |