[llvm-bugs] [Bug 46424] New: false-positive -Wunused-local-typedef warning for use in dependent scope specifier

via llvm-bugs llvm-bugs at lists.llvm.org
Mon Jun 22 13:02:18 PDT 2020


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

            Bug ID: 46424
           Summary: false-positive -Wunused-local-typedef warning for use
                    in dependent scope specifier
           Product: clang
           Version: unspecified
          Hardware: PC
                OS: All
            Status: NEW
          Severity: normal
          Priority: P
         Component: C++11
          Assignee: unassignedclangbugs at nondot.org
          Reporter: richard-llvm at metafoo.co.uk
                CC: blitzrakete at gmail.com, dgregor at apple.com,
                    erik.pilkington at gmail.com, llvm-bugs at lists.llvm.org,
                    richard-llvm at metafoo.co.uk

Testcase from Jens Maurer:

template <class T>
struct B
{
   void f();
};

template <class T>
struct D : public B<T>
{
   using Base = B<T>;
   void f();
};
template <class T>
void g()
{
   D<T> d;
   using X = typename D<T>::Base;
   d.X::f();
}

... produces a bogus warning:

<source>:17:10: warning: unused type alias 'X' [-Wunused-local-typedef]
   using X = typename D<T>::Base;
         ^

(Presumably we are not marking the FirstQualifierInScope as referenced after
doing the fallback lookup for X when parsing g().)

-- 
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/20200622/5840733f/attachment-0001.html>


More information about the llvm-bugs mailing list