summaryrefslogtreecommitdiffstats
path: root/clang/test/SemaCXX/for-range-examples.cpp
diff options
context:
space:
mode:
authorRichard Smith <richard-llvm@metafoo.co.uk>2016-06-23 08:41:20 +0000
committerRichard Smith <richard-llvm@metafoo.co.uk>2016-06-23 08:41:20 +0000
commit19f877c3f2625188b73e77635a409a8ab925ca11 (patch)
tree1cf9c635e6a7465c6c1c6489caac41ffd17c467b /clang/test/SemaCXX/for-range-examples.cpp
parent26036843724d49fcd4678f177c02f0097997c731 (diff)
downloadbcm5719-llvm-19f877c3f2625188b73e77635a409a8ab925ca11.tar.gz
bcm5719-llvm-19f877c3f2625188b73e77635a409a8ab925ca11.zip
Rearrange condition handling so that semantic checks on a condition variable
are performed before the other substatements of the construct are parsed, rather than deferring them until the end. This allows better error recovery from semantic errors in the condition, improves diagnostic order, and is a prerequisite for C++17 constexpr if. llvm-svn: 273548
Diffstat (limited to 'clang/test/SemaCXX/for-range-examples.cpp')
-rw-r--r--clang/test/SemaCXX/for-range-examples.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/clang/test/SemaCXX/for-range-examples.cpp b/clang/test/SemaCXX/for-range-examples.cpp
index 83023e31101..08a9982c637 100644
--- a/clang/test/SemaCXX/for-range-examples.cpp
+++ b/clang/test/SemaCXX/for-range-examples.cpp
@@ -176,9 +176,9 @@ namespace test4 {
// Make sure these don't crash. Better diagnostics would be nice.
for (: {1, 2, 3}) {} // expected-error {{expected expression}} expected-error {{expected ';'}}
- for (1 : {1, 2, 3}) {} // expected-error {{must declare a variable}} expected-warning {{result unused}}
+ for (1 : {1, 2, 3}) {} // expected-error {{must declare a variable}}
for (+x : {1, 2, 3}) {} // expected-error {{undeclared identifier}} expected-error {{expected ';'}}
- for (+y : {1, 2, 3}) {} // expected-error {{must declare a variable}} expected-warning {{result unused}}
+ for (+y : {1, 2, 3}) {} // expected-error {{must declare a variable}}
}
}
OpenPOWER on IntegriCloud