[clang] Handle __declspec() attributes in using
[llvm-project.git] / clang / test / CXX / stmt.stmt / stmt.dcl / p3.cpp
blob03c835b21a623f086091cba451afd536ad9009cc
1 // RUN: %clang_cc1 -fsyntax-only -verify %s
2 // RUN: %clang_cc1 -fsyntax-only -verify -std=c++98 %s
3 // RUN: %clang_cc1 -fsyntax-only -verify -std=c++11 %s
5 // PR10034
6 struct X {};
8 void exx(X) {}
10 int test_ptr10034(int argc, char **argv)
12 if (argc > 3)
13 goto end;
15 X x;
16 X xs[16];
17 exx(x);
19 end:
20 if (argc > 1) {
21 for (int i = 0; i < argc; ++i)
26 return 0;
29 struct Y {
30 ~Y();
33 void test_Y() {
34 goto end; // expected-error{{cannot jump from this goto statement to its label}}
35 Y y; // expected-note{{jump bypasses variable with a non-trivial destructor}}
36 end:
37 return;
40 struct Z {
41 Z operator=(const Z&);
44 void test_Z() {
45 goto end;
46 #if __cplusplus <= 199711L
47 // expected-error@-2 {{cannot jump from this goto statement to its label}}
48 #endif
50 Z z;
51 #if __cplusplus <= 199711L
52 // expected-note@-2 {{jump bypasses initialization of non-POD variable}}
53 #endif
55 end:
56 return;