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

IncludeCleaner: false positive with templates inheriting members #1036

Closed
sam-mccall opened this issue Feb 26, 2022 · 2 comments
Closed

IncludeCleaner: false positive with templates inheriting members #1036

sam-mccall opened this issue Feb 26, 2022 · 2 comments
Assignees
Labels
bug Something isn't working

Comments

@sam-mccall
Copy link
Member

// main.cc
#include "derived.h" // erroneously marked as unused
class Holder {
  void foo() { Member.base(); } // bug goes away if this is missing!
  Derived<0> Member;
};
// derived.h
#pragma once
#include "base.h"
template <int> struct Derived : Base {};
// base.h
struct Base { void base(); }; 
@sam-mccall sam-mccall added the bug Something isn't working label Feb 26, 2022
@sam-mccall
Copy link
Member Author

(This is reduced from examples in LLVM: derived is StringSet and base is StringMap{Impl})

@kirillbobyrev
Copy link
Contributor

Thanks a lot!

mem-frob pushed a commit to draperlaboratory/hope-llvm-project that referenced this issue Oct 7, 2022
For TemplateSpecializationType, we were checking the node's newness
twice, so it always failed the second test.

Fixes clangd/clangd#1036
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants