27 lines · c
1// RUN: %clang_cc1 -DNEEDS_LATE_PARSING -fno-experimental-late-parse-attributes -fsyntax-only -verify %s2// RUN: %clang_cc1 -DNEEDS_LATE_PARSING -fsyntax-only -verify %s3 4// RUN: %clang_cc1 -UNEEDS_LATE_PARSING -fno-experimental-late-parse-attributes -fsyntax-only -verify=ok %s5// RUN: %clang_cc1 -UNEEDS_LATE_PARSING -fsyntax-only -verify=ok %s6 7#define __sized_by_or_null(f) __attribute__((sized_by_or_null(f)))8 9struct size_known { int dummy; };10 11#ifdef NEEDS_LATE_PARSING12struct on_decl {13 // expected-error@+1{{use of undeclared identifier 'count'}}14 struct size_known *buf __sized_by_or_null(count);15 int count;16};17 18#else19 20// ok-no-diagnostics21struct on_decl {22 int count;23 struct size_known *buf __sized_by_or_null(count);24};25 26#endif27