blob: 6d04c84a67522f1ae178f6872bb05d06d23a1f6e [file] [log] [blame]
Chris Lattner6d97e5e2010-03-01 20:59:53 +00001// RUN: %clang_cc1 %s -fsyntax-only -pedantic -verify
Chris Lattnere878eb02008-12-18 02:03:48 +00002
3void foo() {
4 return foo();
5}
Chris Lattner6d97e5e2010-03-01 20:59:53 +00006
7// PR6451 - C++ Jump checking
8struct X {
9 X();
10};
11
12void test2() {
Richard Trieu2fe9b7f2011-12-15 00:38:15 +000013 goto later; // expected-error {{goto into protected scope}}
Chris Lattner6d97e5e2010-03-01 20:59:53 +000014 X x; // expected-note {{jump bypasses variable initialization}}
15later:
16 ;
17}
Douglas Gregor516a6bc2010-03-08 02:45:10 +000018
19namespace PR6536 {
20 struct A {};
21 void a() { goto out; A x; out: return; }
22}