[llvm-bugs] [Bug 41184] New: Wunused-template false positive when template not ODR-used

via llvm-bugs llvm-bugs at lists.llvm.org
Thu Mar 21 09:00:46 PDT 2019


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

            Bug ID: 41184
           Summary: Wunused-template false positive when template not
                    ODR-used
           Product: clang
           Version: trunk
          Hardware: PC
                OS: Linux
            Status: NEW
          Severity: enhancement
          Priority: P
         Component: Frontend
          Assignee: unassignedclangbugs at nondot.org
          Reporter: david at doublewise.net
                CC: llvm-bugs at lists.llvm.org, neeilans at live.com,
                    richard-llvm at metafoo.co.uk

The following code triggers Wunused-template:



#include <type_traits>

namespace {

template<typename T>
auto f() -> T;

static_assert(std::is_same_v<int, decltype(f<int>())>);

} // namespace




When compiled as clang++ -std=c++17 -Wunused-template



See it live: https://godbolt.org/z/1UooFs

-- 
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/20190321/13b398d8/attachment.html>


More information about the llvm-bugs mailing list