summaryrefslogtreecommitdiffstats
path: root/clang/test
diff options
context:
space:
mode:
authorKaelyn Takata <rikka@google.com>2015-05-07 00:11:02 +0000
committerKaelyn Takata <rikka@google.com>2015-05-07 00:11:02 +0000
commitfb8cf4087d21a56186426fe8339bf25e47a4001b (patch)
tree9fd024d2e9fae7feea90b9b9e7ec6eed05ef9275 /clang/test
parent28eb7bf40660288d7f4f2d512e2c6c40fee43331 (diff)
downloadbcm5719-llvm-fb8cf4087d21a56186426fe8339bf25e47a4001b.tar.gz
bcm5719-llvm-fb8cf4087d21a56186426fe8339bf25e47a4001b.zip
When performing delayed typo correction in a for-range loop's variable
declaration, ensure the loop variable is properly marked as invalid when it is an "auto" variable. llvm-svn: 236682
Diffstat (limited to 'clang/test')
-rw-r--r--clang/test/SemaCXX/typo-correction-cxx11.cpp9
1 files changed, 9 insertions, 0 deletions
diff --git a/clang/test/SemaCXX/typo-correction-cxx11.cpp b/clang/test/SemaCXX/typo-correction-cxx11.cpp
index 003d07edb3c..99cb1662b7a 100644
--- a/clang/test/SemaCXX/typo-correction-cxx11.cpp
+++ b/clang/test/SemaCXX/typo-correction-cxx11.cpp
@@ -23,3 +23,12 @@ void test(int aaa, int bbb, int thisvar) { // expected-note {{'thisvar' declare
int thatval = aaa * (bbb + thatvar); // expected-error {{use of undeclared identifier 'thatvar'; did you mean 'thisvar'?}}
}
}
+
+namespace PR18854 {
+void f() {
+ for (auto&& x : e) { // expected-error-re {{use of undeclared identifier 'e'{{$}}}}
+ auto Functor = [x]() {};
+ long Alignment = __alignof__(Functor);
+ }
+}
+}
OpenPOWER on IntegriCloud