Kaelyn Uhrain | deedc3a | 2013-09-26 19:10:34 +0000 | [diff] [blame] | 1 | // RUN: %clang_cc1 -fsyntax-only -verify %s |
| 2 | // RUN: cp %s %t |
| 3 | // RUN: not %clang_cc1 -fsyntax-only -fixit -x c++ %t |
| 4 | // RUN: %clang_cc1 -fsyntax-only -pedantic -Werror -x c++ %t |
| 5 | |
| 6 | namespace dcl_fct_default_p10 { |
| 7 | struct A { |
| 8 | virtual void f(int a = 7); // expected-note{{'A::f' declared here}} |
| 9 | }; |
| 10 | |
| 11 | struct B : public A { |
| 12 | void f(int a); |
| 13 | }; |
| 14 | |
| 15 | void m() { |
| 16 | B* pb = new B; |
| 17 | A* pa = pb; |
| 18 | pa->f(); // OK, calls pa->B::f(7) |
| 19 | pb->f(); // expected-error{{too few arguments to function call, expected 1, have 0; did you mean 'A::f'?}} |
| 20 | } |
| 21 | } |