[clang][Driver] Support simplified triple versions for config files (#111387)
[llvm-project.git] / clang / test / Parser / cxx-typeof.cpp
blobdc72cda7189a1bbe8058ab36df55f7633b62156d
1 // RUN: %clang_cc1 -fsyntax-only -verify %s
2 // RUN: %clang_cc1 -fsyntax-only -verify -std=gnu++98 %s
3 // RUN: %clang_cc1 -fsyntax-only -verify -std=gnu++11 %s
5 static void test() {
6 int *pi;
7 int x;
8 typeof pi[x] y;
11 // From the gcc test suite.
12 struct S {
13 int i;
14 __typeof(S::i) foo();
15 #if __cplusplus <= 199711L
16 // expected-error@-2 {{invalid use of non-static data member 'i'}}
17 #else
18 // expected-no-diagnostics
19 #endif