diff options
author | Richard Smith <richard-llvm@metafoo.co.uk> | 2012-04-05 01:13:04 +0000 |
---|---|---|
committer | Richard Smith <richard-llvm@metafoo.co.uk> | 2012-04-05 01:13:04 +0000 |
commit | a85cf39786fffd6860a940523be01eb02a4935c0 (patch) | |
tree | 49e6b78abb519f6ddf1db6d7a31f3fbd66ea43c7 /test/CXX/expr/expr.prim/expr.prim.lambda/p12.cpp | |
parent | 4fd05dc4062580acea72f8b8231fb0ea3ee49032 (diff) |
Improve diagnostics for invalid use of non-static members / this:
* s/nonstatic/non-static/ in the diagnostics, since the latter form outvoted
the former by 28-2 in our diagnostics.
* Fix the "use of member in static member function" diagnostic to correctly
detect this situation inside a block or lambda.
* Produce a more specific "invalid use of non-static member" diagnostic for
the case where a nested class member refers to a member of a
lexically-surrounding class.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@154073 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test/CXX/expr/expr.prim/expr.prim.lambda/p12.cpp')
-rw-r--r-- | test/CXX/expr/expr.prim/expr.prim.lambda/p12.cpp | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/test/CXX/expr/expr.prim/expr.prim.lambda/p12.cpp b/test/CXX/expr/expr.prim/expr.prim.lambda/p12.cpp index 9da9fcea1f..4a2a4f3d73 100644 --- a/test/CXX/expr/expr.prim/expr.prim.lambda/p12.cpp +++ b/test/CXX/expr/expr.prim/expr.prim.lambda/p12.cpp @@ -27,7 +27,7 @@ struct ReachingThis { static void static_bar() { (void)[this](){}; // expected-error{{'this' cannot be captured in this context}} - (void)[&](){i = 7; }; // expected-error{{invalid use of nonstatic data member 'i'}} + (void)[&](){i = 7; }; // expected-error{{invalid use of member 'i' in static member function}} } }; } |