summaryrefslogtreecommitdiffstats
path: root/test/Parser/cxx-typeof.cpp
blob: c9651b4e1cd7eaebb3e0d5df1c27e1c70d7ed9af (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
// RUN: %clang_cc1 -fsyntax-only -verify %s
// RUN: %clang_cc1 -fsyntax-only -verify -std=gnu++98 %s
// RUN: %clang_cc1 -fsyntax-only -verify -std=gnu++11 %s

static void test() {
  int *pi;
  int x;
  typeof pi[x] y; 
}

// Part of rdar://problem/8347416;  from the gcc test suite.
struct S {
  int i;
  __typeof(S::i) foo();
#if __cplusplus <= 199711L
  // expected-error@-2 {{invalid use of non-static data member 'i'}}
#else
  // expected-no-diagnostics
#endif
};