[LLVMbugs] [Bug 14253] New: No unused warning for variables of non-trivial types

bugzilla-daemon at llvm.org bugzilla-daemon at llvm.org
Sun Nov 4 02:56:49 PST 2012


http://llvm.org/bugs/show_bug.cgi?id=14253

             Bug #: 14253
           Summary: No unused warning for variables of non-trivial types
           Product: clang
           Version: trunk
          Platform: Other
        OS/Version: Linux
            Status: NEW
          Severity: normal
          Priority: P
         Component: C++
        AssignedTo: unassignedclangbugs at nondot.org
        ReportedBy: l.lunak at suse.cz
                CC: dgregor at apple.com, llvmbugs at cs.uiuc.edu
    Classification: Unclassified


Clang warns about unused variables e.g. of type 'int', but not 'std::string' :

$ cat a.cpp
#include <string>

void foo()
    {
    int i;
    std::string s;
    }
$ clang++ -Wall -Wunused -c a.cpp
a.cpp:5:9: warning: unused variable 'i' [-Wunused-variable]
    int i;
        ^
1 warning generated.                                                            

In the function 's' is apparently unused too, but the compiler cannot tell it.

-- 
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