Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

-Wunused-private-field false negative with template instantiation #65111

Open
AaronBallman opened this issue Aug 30, 2023 · 1 comment
Open
Labels
c++11 clang:diagnostics New/improved warning or error message in Clang, but not in clang-tidy or static analyzer enhancement Improving things as opposed to bug fixing, e.g. new or missing feature quality-of-implementation

Comments

@AaronBallman
Copy link
Collaborator

Consider code like:

template <typename Ty, typename Uy>
class C2 {
  Ty c; // no-warning
  Uy d; // warning
};

class [[maybe_unused]] Good {};
class Bad {};

C2<Good, Bad> c;

Clang fails to diagnose d: https://godbolt.org/z/qjE5sxqff

This was discovered during review of https://reviews.llvm.org/D159083, for more context.

@AaronBallman AaronBallman added enhancement Improving things as opposed to bug fixing, e.g. new or missing feature c++11 quality-of-implementation clang:diagnostics New/improved warning or error message in Clang, but not in clang-tidy or static analyzer labels Aug 30, 2023
@llvmbot
Copy link
Collaborator

llvmbot commented Aug 30, 2023

@llvm/issue-subscribers-c-11

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
c++11 clang:diagnostics New/improved warning or error message in Clang, but not in clang-tidy or static analyzer enhancement Improving things as opposed to bug fixing, e.g. new or missing feature quality-of-implementation
Projects
None yet
Development

No branches or pull requests

2 participants