[llvm-bugs] [Bug 33298] New: Invalid -Wunused-local-typedef warning inside local type of function template.

via llvm-bugs llvm-bugs at lists.llvm.org
Sat Jun 3 17:22:50 PDT 2017


https://bugs.llvm.org/show_bug.cgi?id=33298

            Bug ID: 33298
           Summary: Invalid -Wunused-local-typedef warning inside local
                    type of function template.
           Product: clang
           Version: 4.0
          Hardware: PC
                OS: Linux
            Status: NEW
          Severity: enhancement
          Priority: P
         Component: C++
          Assignee: unassignedclangbugs at nondot.org
          Reporter: jordan.woyak at gmail.com
                CC: dgregor at apple.com, llvm-bugs at lists.llvm.org

template <typename T>
int func()
{
        struct inner
        {
                typedef int my_type;

                my_type x;
        };

        inner i;
        i.x = 0;
        return i.x;
}

int main()
{
        return func<void>();
}

$ clang -Wunused-local-typedef clangbug.cpp 
clangbug.cpp:7:15: warning: unused typedef 'my_type' [-Wunused-local-typedef]
                typedef int my_type;
                            ^
1 warning generated.

$ clang --version
clang version 4.0.0 (tags/RELEASE_400/final)
Target: x86_64-unknown-linux-gnu
Thread model: posix
InstalledDir: /usr/bin

-- 
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/20170604/1f0540e2/attachment.html>


More information about the llvm-bugs mailing list