[LLVMbugs] [Bug 18265] New: Please add support for Wunused-local-typedefs/Wno-unused-local-typedefs

bugzilla-daemon at llvm.org bugzilla-daemon at llvm.org
Mon Dec 16 18:17:20 PST 2013


            Bug ID: 18265
           Summary: Please add support for
           Product: new-bugs
           Version: 3.3
          Hardware: PC
                OS: Linux
            Status: NEW
          Severity: enhancement
          Priority: P
         Component: new bugs
          Assignee: unassignedbugs at nondot.org
          Reporter: austinenglish at gmail.com
                CC: llvmbugs at cs.uiuc.edu
    Classification: Unclassified

Supported by gcc, but not supported by clang. More info:
New warnings for unused local typedefs

The behavior of -Wall has changed and now includes the new warning flag
-Wunused-local-typedefs. This may result in new warnings in code that compiled
cleanly with previous versions of GCC.

For example,

template<typename _Tp>
  foo(_Tp __a)
    typedef int return_type;
    return 5;

int i = foo(415);

Gives the following diagnostic:

warning: typedef ‘return_type’ locally defined but not used
     typedef int return_type;

Although these warnings will not result in compilation failure, often -Wall is
used in conjunction with -Werror and as a result, new warnings are turned into
new errors.

To fix, simply remove the unused typedef.

As a workaround, use -Wno-unused-local-typedefs. 


You are receiving this mail because:
You are on the CC list for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-bugs/attachments/20131217/3374efb7/attachment.html>

More information about the llvm-bugs mailing list