- Actually building the var -> capture mapping properly (there was an off-by-one error) - Keeping track of the source location of each capture - Minor QoI improvements, e.g, highlighing the prior capture if there are multiple captures, pointing at the variable declaration we found if we reject it. As part of this, add standard citations for the various semantic checks we perform, and note where we're not performing those checks as we should. llvm-svn: 149462
17 lines
829 B
C++
17 lines
829 B
C++
// RUN: %clang_cc1 -std=c++11 %s -verify
|
|
|
|
class X0 {
|
|
void explicit_capture() {
|
|
int foo;
|
|
|
|
[foo, foo] () {}; // expected-error {{'foo' can appear only once}} expected-error {{not supported yet}}
|
|
[this, this] () {}; // expected-error {{'this' can appear only once}} expected-error {{not supported yet}}
|
|
[=, foo] () {}; // expected-error {{'&' must precede a capture when}} expected-error {{not supported yet}}
|
|
[=, &foo] () {}; // expected-error {{not supported yet}}
|
|
[=, this] () {}; // expected-error {{'this' cannot appear}} expected-error {{not supported yet}}
|
|
[&, foo] () {}; // expected-error {{not supported yet}}
|
|
[&, &foo] () {}; // expected-error {{'&' cannot precede a capture when}} expected-error {{not supported yet}}
|
|
[&, this] () {}; // expected-error {{not supported yet}}
|
|
}
|
|
};
|