blob: 5a87cc8e67e6c37b2565b50c8c82b30404eac1ea [file] [log] [blame]
Douglas Gregor7ad5d422010-11-09 21:07:58 +00001// RUN: %clang_cc1 -fsyntax-only -verify %s
2
Douglas Gregordb2eae62011-03-16 19:16:25 +00003int ovl(int); // expected-note 3{{candidate function}}
4float ovl(float); // expected-note 3{{candidate function}}
Douglas Gregor7ad5d422010-11-09 21:07:58 +00005
Douglas Gregordb2eae62011-03-16 19:16:25 +00006template<typename T> T ovl(T); // expected-note 3{{candidate function}}
Douglas Gregor7ad5d422010-11-09 21:07:58 +00007
8void test(bool b) {
Douglas Gregordb2eae62011-03-16 19:16:25 +00009 (void)((void)0, ovl); // expected-error{{cannot resolve overloaded function 'ovl' from context}}
Douglas Gregor7ad5d422010-11-09 21:07:58 +000010 // PR7863
Douglas Gregordb2eae62011-03-16 19:16:25 +000011 (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 Gregor7ad5d422010-11-09 21:07:58 +000013 (void)(b? ovl<float> : ovl<float>);
14}