freebsd-dev/test/SemaCXX/statements.cpp

23 lines
394 B
C++
Raw Normal View History

2010-03-03 17:28:16 +00:00
// RUN: %clang_cc1 %s -fsyntax-only -pedantic -verify
2009-06-02 17:58:47 +00:00
void foo() {
return foo();
}
2010-03-03 17:28:16 +00:00
// PR6451 - C++ Jump checking
struct X {
X();
};
void test2() {
goto later; // expected-error {{illegal goto into protected scope}}
X x; // expected-note {{jump bypasses variable initialization}}
later:
;
}
2010-03-10 17:45:58 +00:00
namespace PR6536 {
struct A {};
void a() { goto out; A x; out: return; }
}