[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


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

            Bug ID: 47717
           Summary: -Wunused-private-field on member accessed via template
                    parameter
           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]
public:
    int f(std::derived_from<C> auto& other) { return ++other.i; }
};
https://godbolt.org/z/zoYKc7
clang version 12.0.0 (https://github.com/llvm/llvm-project.git
88c9162c9d47ef43a505bc5301dc626f3cd4f437)

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
motivation.

-- 
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