summaryrefslogtreecommitdiffstats
path: root/clang/test/SemaCXX/for-range-examples.cpp
diff options
context:
space:
mode:
authorJohn McCall <rjmccall@apple.com>2012-01-27 01:29:43 +0000
committerJohn McCall <rjmccall@apple.com>2012-01-27 01:29:43 +0000
commitcf6e0c839dbdec83d3bc56634662f085cfc7b730 (patch)
treec893e9d56491be0c3677ab2be2f9c8864bb17838 /clang/test/SemaCXX/for-range-examples.cpp
parent253c2a390ac95ef9a3039ea6b4e37de6ba13462e (diff)
downloadbcm5719-llvm-cf6e0c839dbdec83d3bc56634662f085cfc7b730.tar.gz
bcm5719-llvm-cf6e0c839dbdec83d3bc56634662f085cfc7b730.zip
Be sure to emit delayed diagnostics after parsing the declaration
of a for-range variable. Fixes PR11793. llvm-svn: 149109
Diffstat (limited to 'clang/test/SemaCXX/for-range-examples.cpp')
-rw-r--r--clang/test/SemaCXX/for-range-examples.cpp10
1 files changed, 10 insertions, 0 deletions
diff --git a/clang/test/SemaCXX/for-range-examples.cpp b/clang/test/SemaCXX/for-range-examples.cpp
index b994e8c10bd..dd356032cfb 100644
--- a/clang/test/SemaCXX/for-range-examples.cpp
+++ b/clang/test/SemaCXX/for-range-examples.cpp
@@ -148,3 +148,13 @@ int main() {
}
assert(total == 500);
}
+
+// PR11793
+namespace test2 {
+ class A {
+ int xs[10]; // expected-note {{implicitly declared private here}}
+ };
+ void test(A &a) {
+ for (int x : a.xs) { } // expected-error {{'xs' is a private member of 'test2::A'}}
+ }
+}
OpenPOWER on IntegriCloud