2010-03-02 04:59:53 +08:00
|
|
|
// RUN: %clang_cc1 %s -fsyntax-only -pedantic -verify
|
2008-12-18 10:03:48 +08:00
|
|
|
|
|
|
|
void foo() {
|
|
|
|
return foo();
|
|
|
|
}
|
2010-03-02 04:59:53 +08:00
|
|
|
|
|
|
|
// PR6451 - C++ Jump checking
|
|
|
|
struct X {
|
|
|
|
X();
|
|
|
|
};
|
|
|
|
|
|
|
|
void test2() {
|
2011-12-15 08:38:15 +08:00
|
|
|
goto later; // expected-error {{goto into protected scope}}
|
2010-03-02 04:59:53 +08:00
|
|
|
X x; // expected-note {{jump bypasses variable initialization}}
|
|
|
|
later:
|
|
|
|
;
|
|
|
|
}
|
2010-03-08 10:45:10 +08:00
|
|
|
|
|
|
|
namespace PR6536 {
|
|
|
|
struct A {};
|
|
|
|
void a() { goto out; A x; out: return; }
|
|
|
|
}
|