brintos

brintos / llvm-project-archived public Read only

0
0
Text · 1.2 KiB · a4dd263 Raw
35 lines · c
1// RUN: %clang_cc1 -fsyntax-only -pedantic -verify %s2// RUN: cp %s %t3// RUN: not %clang_cc1 -pedantic -fixit -x c %t4// RUN: %clang_cc1 -pedantic -Werror -Wno-invalid-noreturn -x c %t5 6/* This is a test of the various code modification hints that are7   provided as part of warning or extension diagnostics. All of the8   warnings will be fixed by -fixit, and the resulting file should9   compile cleanly with -Werror -pedantic. */10 11struct 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}}14 15struct Point {16  float x, y, z;17};18 19struct Point *get_origin(void);20 21void test_point(void) {22  (void)get_origin->x; // expected-error {{base of member reference is a function; perhaps you meant to call it with no arguments?}}23}24 25// These errors require C11.26#if __STDC_VERSION__ > 199901L27void noreturn_1(void) _Noreturn; // expected-error {{must precede function declarator}}28void noreturn_1(void) {29  return; // expected-warning {{should not return}}30}31void noreturn_2(void) _Noreturn { // expected-error {{must precede function declarator}}32  return; // expected-warning {{should not return}}33}34#endif35