[clazy] [Bug 410754] New: [check proposal] warn against unused template arguments

Jean-Michaƫl Celerier bugzilla_noreply at kde.org
Fri Aug 9 09:46:36 BST 2019


https://bugs.kde.org/show_bug.cgi?id=410754

            Bug ID: 410754
           Summary: [check proposal] warn against unused template
                    arguments
           Product: clazy
           Version: unspecified
          Platform: Other
                OS: Linux
            Status: REPORTED
          Severity: normal
          Priority: NOR
         Component: general
          Assignee: unassigned-bugs at kde.org
          Reporter: jeanmichael.celerier at gmail.com
                CC: smartins at kde.org
  Target Milestone: ---

This case has cost me some long minutes staring at my screen while refactoring
some code - you remove an argument to a template function (say u in
template<...> void f(T t, U u)), but forget to remove "typename U" from the
list of template arguments, which removes your function from the overload set
or cause even worse things.

The idea for this check would be to look for trivial template arguments (e.g.
strictly things such as `typename T` or `class T`, not non-type template
arguments, not defaulted types, etc...) and emit a warning if they are not used
anywhere in the function parameter list or body.

-- 
You are receiving this mail because:
You are the assignee for the bug.


More information about the Unassigned-bugs mailing list