diff options
Diffstat (limited to 'test/SemaCXX/goto.cpp')
-rw-r--r-- | test/SemaCXX/goto.cpp | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/test/SemaCXX/goto.cpp b/test/SemaCXX/goto.cpp new file mode 100644 index 0000000000..2db9d97fd8 --- /dev/null +++ b/test/SemaCXX/goto.cpp @@ -0,0 +1,18 @@ +// RUN: %clang_cc1 -fsyntax-only -verify %s + +// PR9463 +double *end; +void f() { + { + int end = 0; + goto end; + end = 1; + } + + end: + return; +} + +void g() { + end = 1; // expected-error{{assigning to 'double *' from incompatible type 'int'}} +} |