[LLVMbugs] [Bug 9415] New: Annoying -Wunused-function

bugzilla-daemon at llvm.org bugzilla-daemon at llvm.org
Sun Mar 6 10:04:20 PST 2011


           Summary: Annoying -Wunused-function
           Product: clang
           Version: trunk
          Platform: PC
        OS/Version: All
            Status: NEW
          Severity: enhancement
          Priority: P
         Component: C++
        AssignedTo: unassignedclangbugs at nondot.org
        ReportedBy: chris at bubblescope.net
                CC: llvmbugs at cs.uiuc.edu, dgregor at apple.com

The following code:

namespace {
template<class T>
inline void char_less(T t1, T t2)
{ }

inline void char_less<char>(char t1, char t2)
{ }


Is triggered by -Wunused-function :

warning: unused function 'char_less' [-Wunused-function]
inline void char_less<char>(char t1, char t2)

Putting functions in unnamed namespaces is a common trick. While
-Wunused-function is not triggered by the templated function, it is triggered
by the specialization.

Configure bugmail: http://llvm.org/bugs/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are on the CC list for the bug.

More information about the llvm-bugs mailing list