diff --git a/clang/include/clang/Basic/DiagnosticGroups.td b/clang/include/clang/Basic/DiagnosticGroups.td index 61928f03c847..3d8255e8744c 100644 --- a/clang/include/clang/Basic/DiagnosticGroups.td +++ b/clang/include/clang/Basic/DiagnosticGroups.td @@ -133,7 +133,7 @@ def UnknownAttributes : DiagGroup<"unknown-attributes">; def UnusedArgument : DiagGroup<"unused-argument">; def UnusedExceptionParameter : DiagGroup<"unused-exception-parameter">; def UnusedFunction : DiagGroup<"unused-function">; -def UnusedMethod : DiagGroup<"unused-method">; +def UnusedMemberFunction : DiagGroup<"unused-member-function">; def UnusedLabel : DiagGroup<"unused-label">; def UnusedParameter : DiagGroup<"unused-parameter">; def UnusedValue : DiagGroup<"unused-value">; @@ -168,7 +168,7 @@ def Conversion : DiagGroup<"conversion", def Unused : DiagGroup<"unused", [UnusedArgument, UnusedFunction, UnusedLabel, // UnusedParameter, (matches GCC's behavior) - // UnusedMethod, (clean-up llvm before enabling) + // UnusedMemberFunction, (clean-up llvm before enabling) UnusedValue, UnusedVariable]>, DiagCategory<"Unused Entity Issue">; @@ -187,7 +187,7 @@ def Extra : DiagGroup<"extra", [ InitializerOverrides, SemiBeforeMethodBody, SignCompare, - UnusedMethod, + UnusedMemberFunction, UnusedParameter ]>; diff --git a/clang/include/clang/Basic/DiagnosticSemaKinds.td b/clang/include/clang/Basic/DiagnosticSemaKinds.td index 6f525ca16c1d..f20c19924640 100644 --- a/clang/include/clang/Basic/DiagnosticSemaKinds.td +++ b/clang/include/clang/Basic/DiagnosticSemaKinds.td @@ -104,8 +104,8 @@ def warn_decl_in_param_list : Warning< "declaration of %0 will not be visible outside of this function">; def warn_unused_function : Warning<"unused function %0">, InGroup, DefaultIgnore; -def warn_unused_method : Warning<"unused method %0">, - InGroup, DefaultIgnore; +def warn_unused_member_function : Warning<"unused member function %0">, + InGroup, DefaultIgnore; def warn_implicit_function_decl : Warning< "implicit declaration of function %0">, diff --git a/clang/lib/Sema/Sema.cpp b/clang/lib/Sema/Sema.cpp index 92e3fdd72adb..03feed0e5425 100644 --- a/clang/lib/Sema/Sema.cpp +++ b/clang/lib/Sema/Sema.cpp @@ -377,7 +377,7 @@ void Sema::ActOnEndOfTranslationUnit() { if (!FD->hasBody(DiagD)) DiagD = FD; Diag(DiagD->getLocation(), - isa(DiagD) ? diag::warn_unused_method + isa(DiagD) ? diag::warn_unused_member_function : diag::warn_unused_function) << DiagD->getDeclName(); } else { diff --git a/clang/test/SemaCXX/warn-unused-filescoped.cpp b/clang/test/SemaCXX/warn-unused-filescoped.cpp index 37acecb0f3fd..75fc6a4da0ba 100644 --- a/clang/test/SemaCXX/warn-unused-filescoped.cpp +++ b/clang/test/SemaCXX/warn-unused-filescoped.cpp @@ -1,4 +1,4 @@ -// RUN: %clang_cc1 -fsyntax-only -verify -Wunused -Wunused-method %s +// RUN: %clang_cc1 -fsyntax-only -verify -Wunused -Wunused-member-function %s static void f1(); // expected-warning{{unused}}