diff options
Diffstat (limited to 'clang/test/Parser/cxx1z-init-statement.cpp')
-rw-r--r-- | clang/test/Parser/cxx1z-init-statement.cpp | 28 |
1 files changed, 15 insertions, 13 deletions
diff --git a/clang/test/Parser/cxx1z-init-statement.cpp b/clang/test/Parser/cxx1z-init-statement.cpp index c118522e8c4..3d119ef8e70 100644 --- a/clang/test/Parser/cxx1z-init-statement.cpp +++ b/clang/test/Parser/cxx1z-init-statement.cpp @@ -4,18 +4,18 @@ int g, h; typedef int T; int f() { // init-statement declarations - if (T n = 0; n != 0) {} // expected-error {{not yet supported}} - if (T f(); f()) {} // expected-error {{not yet supported}} - if (T(f()); f()) {} // expected-error {{not yet supported}} - if (T(f()), g, h; f()) {} // expected-error {{not yet supported}} - if (T f(); f()) {} // expected-error {{not yet supported}} - if (T f(), g, h; f()) {} // expected-error {{not yet supported}} - if (T(n) = 0; n) {} // expected-error {{not yet supported}} + if (T n = 0; n != 0) {} + if (T f(); f()) {} + if (T(f()); f()) {} + if (T(f()), g, h; f()) {} + if (T f(); f()) {} + if (T f(), g, h; f()) {} + if (T(n) = 0; n) {} // init-statement expressions - if (T{f()}; f()) {} // expected-error {{not yet supported}} - if (T{f()}, g, h; f()) {} // expected-error {{not yet supported}} expected-warning 2{{unused}} - if (T(f()), g, h + 1; f()) {} // expected-error {{not yet supported}} expected-warning 2{{unused}} + if (T{f()}; f()) {} + if (T{f()}, g, h; f()) {} // expected-warning 2{{unused}} + if (T(f()), g, h + 1; f()) {} // expected-warning 2{{unused}} // condition declarations if (T(n){g}) {} @@ -34,10 +34,10 @@ int f() { if (T(n)(int())) {} // expected-error {{undeclared identifier 'n'}} // Likewise for 'switch' - switch (int n; n) {} // expected-error {{not yet supported}} - switch (g; int g = 5) {} // expected-error {{not yet supported}} + switch (int n; n) {} + switch (g; int g = 5) {} - if (int a, b; int c = a) { // expected-error {{not yet supported}} expected-note 6{{previous}} + if (int a, b; int c = a) { // expected-note 6{{previous}} int a; // expected-error {{redefinition}} int b; // expected-error {{redefinition}} int c; // expected-error {{redefinition}} @@ -46,4 +46,6 @@ int f() { int b; // expected-error {{redefinition}} int c; // expected-error {{redefinition}} } + + return 0; } |