[llvm-bugs] [Bug 47717] New: -Wunused-private-field on member accessed via template parameter

via llvm-bugs llvm-bugs at lists.llvm.org
Sat Oct 3 04:57:08 PDT 2020


            Bug ID: 47717
           Summary: -Wunused-private-field on member accessed via template
           Product: clang
           Version: trunk
          Hardware: PC
                OS: Linux
            Status: NEW
          Severity: normal
          Priority: P
         Component: C++
          Assignee: unassignedclangbugs at nondot.org
          Reporter: ed at catmur.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

#include <concepts>
class C {
    int i; // warning: private field 'i' is not used [-Wunused-private-field]
    int f(std::derived_from<C> auto& other) { return ++other.i; }
clang version 12.0.0 (https://github.com/llvm/llvm-project.git

Not sure whether this is valid, but it'd be nice if this was regarded as a
possible use of C::i.

nb. the derived_from is not necessary to exhibit the issue, but demonstrates

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/20201003/ae1eb7cf/attachment.html>

More information about the llvm-bugs mailing list