21 lines · cpp
1// RUN: %clang_cc1 -fsyntax-only -verify %s2// RUN: %clang_cc1 -fsyntax-only -verify -std=gnu++98 %s3// RUN: %clang_cc1 -fsyntax-only -verify -std=gnu++11 %s4 5static void test() {6 int *pi;7 int x;8 typeof pi[x] y; 9}10 11// From the gcc test suite.12struct S {13 int i;14 __typeof(S::i) foo();15#if __cplusplus <= 199711L16 // expected-error@-2 {{invalid use of non-static data member 'i'}}17#else18 // expected-no-diagnostics19#endif20};21