diff options
author | John McCall <rjmccall@apple.com> | 2012-01-27 01:29:43 +0000 |
---|---|---|
committer | John McCall <rjmccall@apple.com> | 2012-01-27 01:29:43 +0000 |
commit | 6895a644ca9df03af14ad06deaa950a09dd352d2 (patch) | |
tree | 851a522581f5b31167ca4188ce0fb829ecabe922 /test/SemaCXX/for-range-examples.cpp | |
parent | 745f5147e065900267c85a5568785a1991d4838f (diff) |
Be sure to emit delayed diagnostics after parsing the declaration
of a for-range variable. Fixes PR11793.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@149109 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test/SemaCXX/for-range-examples.cpp')
-rw-r--r-- | test/SemaCXX/for-range-examples.cpp | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/test/SemaCXX/for-range-examples.cpp b/test/SemaCXX/for-range-examples.cpp index b994e8c10b..dd356032cf 100644 --- a/test/SemaCXX/for-range-examples.cpp +++ b/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'}} + } +} |