Douglas Gregor | 506ae41 | 2009-01-16 18:33:17 +0000 | [diff] [blame] | 1 | // RUN: clang -fsyntax-only -verify %s |
| 2 | |
| 3 | struct SimpleValueInit { |
| 4 | int i; |
| 5 | }; |
| 6 | |
| 7 | struct InitViaConstructor { |
| 8 | InitViaConstructor(int i = 7); |
| 9 | }; |
| 10 | |
| 11 | // FIXME: error messages for implicitly-declared special member |
| 12 | // function candidates are very poor |
Sebastian Redl | 3cb0692 | 2009-02-07 19:52:04 +0000 | [diff] [blame^] | 13 | struct NoValueInit { // expected-note 2 {{candidate function}} |
| 14 | NoValueInit(int i, int j); // expected-note 2 {{candidate function}} |
Douglas Gregor | 506ae41 | 2009-01-16 18:33:17 +0000 | [diff] [blame] | 15 | }; |
| 16 | |
| 17 | void test_cxx_functional_value_init() { |
| 18 | (void)SimpleValueInit(); |
| 19 | (void)InitViaConstructor(); |
| 20 | (void)NoValueInit(); // expected-error{{no matching constructor for initialization}} |
| 21 | } |
| 22 | |
| 23 | void test_cxx_function_cast_multi() { |
| 24 | (void)NoValueInit(0, 0); |
| 25 | (void)NoValueInit(0, 0, 0); // expected-error{{no matching constructor for initialization}} |
| 26 | (void)int(1, 2); // expected-error{{function-style cast to a builtin type can only take one argument}} |
| 27 | } |