forked from OSchip/llvm-project
Add a missing test for the __if_exists extension
MSVC does not create a new scope for the body of an __if_exists compound statement. Clang already gets this right today, but it was untested. llvm-svn: 211650
This commit is contained in:
parent
27e1473143
commit
6be648f047
|
@ -25,6 +25,16 @@ void test_if_exists_stmts() {
|
|||
}
|
||||
}
|
||||
|
||||
int if_exists_creates_no_scope() {
|
||||
__if_exists(MayExist::Type) {
|
||||
int x; // 'x' is declared in the parent scope.
|
||||
}
|
||||
__if_not_exists(MayExist::Type_not) {
|
||||
x++;
|
||||
}
|
||||
return x;
|
||||
}
|
||||
|
||||
__if_exists(MayExist::Type) {
|
||||
int var23;
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue