aboutsummaryrefslogtreecommitdiff
path: root/test/FixIt/fixit-cxx0x.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'test/FixIt/fixit-cxx0x.cpp')
-rw-r--r--test/FixIt/fixit-cxx0x.cpp12
1 files changed, 12 insertions, 0 deletions
diff --git a/test/FixIt/fixit-cxx0x.cpp b/test/FixIt/fixit-cxx0x.cpp
index 28a96198bd..e642b057a2 100644
--- a/test/FixIt/fixit-cxx0x.cpp
+++ b/test/FixIt/fixit-cxx0x.cpp
@@ -46,3 +46,15 @@ namespace ScopedEnum {
friend enum class E; // expected-error {{must use 'enum' not 'enum class'}}
};
}
+
+struct S2 {
+ void f(int i);
+ void g(int i);
+};
+
+void S2::f(int i) {
+ (void)[&, &i, &i]{}; // expected-error 2{{'&' cannot precede a capture when the capture default is '&'}}
+ (void)[=, this]{ this->g(5); }; // expected-error{{'this' cannot be explicitly captured}}
+ (void)[i, i]{ }; // expected-error{{'i' can appear only once in a capture list}}
+ (void)[&, i, i]{ }; // expected-error{{'i' can appear only once in a capture list}}
+}