blob: c425fc8a2d954ff3c8821274e2866b9b5c76bcbf [file] [log] [blame]
Dmitri Gribenkod0860682013-01-25 22:08:24 +00001// RUN: %clang_cc1 -fsyntax-only -pedantic -verify %s
Nick Lewyckyba5f6ec2010-04-24 01:30:46 +00002// RUN: cp %s %t
Dmitri Gribenkod0860682013-01-25 22:08:24 +00003// RUN: not %clang_cc1 -pedantic -fixit -x c %t
Nick Lewyckyba5f6ec2010-04-24 01:30:46 +00004// RUN: %clang_cc1 -pedantic -Werror -x c %t
Douglas Gregora3a83512009-04-01 23:51:29 +00005
6/* This is a test of the various code modification hints that are
Douglas Gregorfe057ac2009-04-02 03:20:30 +00007 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 Gregora3a83512009-04-01 23:51:29 +000011struct s; // expected-note{{previous use is here}}
12
13union s *s1; // expected-error{{use of 's' with tag type that does not match previous declaration}}
Douglas Gregor3f0b5fd2009-11-06 06:30:47 +000014
15struct Point {
16 float x, y, z;
17};
18
19struct Point *get_origin();
20
21void test_point() {
Dmitri Gribenkod0860682013-01-25 22:08:24 +000022 (void)get_origin->x; // expected-error {{base of member reference is a function; perhaps you meant to call it with no arguments?}}
Douglas Gregor3f0b5fd2009-11-06 06:30:47 +000023}