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 /include/clang/Basic/DiagnosticSemaKinds.td | |
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 'include/clang/Basic/DiagnosticSemaKinds.td')
-rw-r--r-- | include/clang/Basic/DiagnosticSemaKinds.td | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/include/clang/Basic/DiagnosticSemaKinds.td b/include/clang/Basic/DiagnosticSemaKinds.td index 3ecb4a7c80..a89217c472 100644 --- a/include/clang/Basic/DiagnosticSemaKinds.td +++ b/include/clang/Basic/DiagnosticSemaKinds.td @@ -3769,7 +3769,7 @@ def warn_null_in_comparison_operation : Warning< InGroup<DiagGroup<"null-arithmetic">>; def err_invalid_this_use : Error< - "invalid use of 'this' outside of a nonstatic member function">; + "invalid use of 'this' outside of a non-static member function">; def err_invalid_member_use_in_static_method : Error< "invalid use of member %0 in static member function">; def err_invalid_qualified_function_type : Error< @@ -3785,7 +3785,10 @@ def err_ref_qualifier_overload : Error< "without a ref-qualifier|with ref-qualifier '&'|with ref-qualifier '&&'}1">; def err_invalid_non_static_member_use : Error< - "invalid use of nonstatic data member %0">; + "invalid use of non-static data member %0">; +def err_nested_non_static_member_use : Error< + "%select{call to non-static member function|use of non-static data member}0 " + "%2 of %1 from nested type %3">; def warn_cxx98_compat_non_static_member_use : Warning< "use of non-static data member %0 in an unevaluated context is " "incompatible with C++98">, InGroup<CXX98Compat>, DefaultIgnore; |