blob: 1ec6e29b1311f73812edcf3725c906791a5ddd65 [file] [log] [blame]
Daniel Dunbara5728872009-12-15 20:14:24 +00001// RUN: %clang_cc1 -fsyntax-only -verify %s
Argyrios Kyrtzidis0f072032008-09-05 11:26:19 +00002
3static void test() {
4 int *pi;
5 int x;
6 typeof pi[x] y;
7}
John McCall124300e2010-08-24 23:41:43 +00008
9// Part of rdar://problem/8347416; from the gcc test suite.
10struct S {
11 int i;
Richard Smitha85cf392012-04-05 01:13:04 +000012 __typeof(S::i) foo(); // expected-error {{invalid use of non-static data member 'i'}}
John McCall124300e2010-08-24 23:41:43 +000013};