summaryrefslogtreecommitdiffstats
path: root/clang/test/CXX/drs/dr22xx.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'clang/test/CXX/drs/dr22xx.cpp')
-rw-r--r--clang/test/CXX/drs/dr22xx.cpp11
1 files changed, 11 insertions, 0 deletions
diff --git a/clang/test/CXX/drs/dr22xx.cpp b/clang/test/CXX/drs/dr22xx.cpp
index 021707d876b..70a26db757c 100644
--- a/clang/test/CXX/drs/dr22xx.cpp
+++ b/clang/test/CXX/drs/dr22xx.cpp
@@ -15,3 +15,14 @@ struct AnonBitfieldQualifiers {
const volatile unsigned i3 : 1;
};
}
+
+#if __cplusplus >= 201103L
+namespace dr2211 { // dr2211: 8
+void f() {
+ int a;
+ auto f = [a](int a) { (void)a; }; // expected-error {{a lambda parameter cannot shadow an explicitly captured entity}}
+ // expected-note@-1{{variable 'a' is explicitly captured here}}
+ auto g = [=](int a) { (void)a; };
+}
+}
+#endif
OpenPOWER on IntegriCloud