brintos

brintos / llvm-project-archived public Read only

0
0
Text · 922 B · 03c835b Raw
58 lines · cpp
1// RUN: %clang_cc1 -fsyntax-only -verify %s2// RUN: %clang_cc1 -fsyntax-only -verify -std=c++98 %s3// RUN: %clang_cc1 -fsyntax-only -verify -std=c++11 %s4 5// PR100346struct X {};7 8void exx(X) {}9 10int test_ptr10034(int argc, char **argv)11{12 if (argc > 3)13   goto end;14 15 X x;16 X xs[16];17 exx(x);18 19 end:20   if (argc > 1) {21   for (int i = 0; i < argc; ++i)22   {23 24   }25   }26   return 0;27}28 29struct Y {30  ~Y();31};32 33void 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;38}39 40struct Z {41  Z operator=(const Z&);42};43 44void test_Z() {45  goto end;46#if __cplusplus <= 199711L47  // expected-error@-2 {{cannot jump from this goto statement to its label}}48#endif49 50  Z z;51#if __cplusplus <= 199711L52  // expected-note@-2 {{jump bypasses initialization of non-POD variable}}53#endif54 55 end:56  return;57}58