| Dmitri Gribenko | d086068 | 2013-01-25 22:08:24 +0000 | [diff] [blame] | 1 | // RUN: %clang_cc1 -fsyntax-only -pedantic -verify %s | 
| Nick Lewycky | ba5f6ec | 2010-04-24 01:30:46 +0000 | [diff] [blame] | 2 | // RUN: cp %s %t | 
| Dmitri Gribenko | d086068 | 2013-01-25 22:08:24 +0000 | [diff] [blame] | 3 | // RUN: not %clang_cc1 -pedantic -fixit -x c %t | 
| Nick Lewycky | ba5f6ec | 2010-04-24 01:30:46 +0000 | [diff] [blame] | 4 | // RUN: %clang_cc1 -pedantic -Werror -x c %t | 
| Douglas Gregor | a3a8351 | 2009-04-01 23:51:29 +0000 | [diff] [blame] | 5 |  | 
 | 6 | /* This is a test of the various code modification hints that are | 
| Douglas Gregor | fe057ac | 2009-04-02 03:20:30 +0000 | [diff] [blame] | 7 |    provided as part of warning or extension diagnostics. All of the | 
 | 8 |    warnings will be fixed by -fixit, and the resulting file should | 
 | 9 |    compile cleanly with -Werror -pedantic. */ | 
 | 10 |  | 
| Douglas Gregor | a3a8351 | 2009-04-01 23:51:29 +0000 | [diff] [blame] | 11 | struct s; // expected-note{{previous use is here}} | 
 | 12 |  | 
 | 13 | union s *s1; // expected-error{{use of 's' with tag type that does not match previous declaration}} | 
| Douglas Gregor | 3f0b5fd | 2009-11-06 06:30:47 +0000 | [diff] [blame] | 14 |  | 
 | 15 | struct Point { | 
 | 16 |   float x, y, z; | 
 | 17 | }; | 
 | 18 |  | 
 | 19 | struct Point *get_origin(); | 
 | 20 |  | 
 | 21 | void test_point() { | 
| Dmitri Gribenko | d086068 | 2013-01-25 22:08:24 +0000 | [diff] [blame] | 22 |   (void)get_origin->x; // expected-error {{base of member reference is a function; perhaps you meant to call it with no arguments?}} | 
| Douglas Gregor | 3f0b5fd | 2009-11-06 06:30:47 +0000 | [diff] [blame] | 23 | } |