-
Notifications
You must be signed in to change notification settings - Fork 12.8k
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
False positive of -Wunused-local-typedef in dependent code. #98878
Comments
@llvm/issue-subscribers-clang-frontend Author: Haojian Wu (hokein)
Given the following code:
clang emits a unused typedef warning.
This is shown in abseil/abseil-cpp#1711. |
This doesn't repro for me, using a 3-week old clang:
Am I holding it wrong? Does it require a very recent clang to repro? |
It can be reproduced in trunk, https://godbolt.org/z/Go4751bd8, looks like a recent regression. |
I was definitely getting the warning on clang 18 in the non-reduced case in abseil. |
This can be reproduced with clang 18 with:
|
This looks like what you mean I think: https://godbolt.org/z/7nrdeM535 #define TYPE_OR_NONTYPE typename
template<TYPE_OR_NONTYPE T>
struct BaseT {
static int ff();
void Foo();
};
template<TYPE_OR_NONTYPE T>
struct DerivedT : BaseT<T> {
void Inner();
};
template<TYPE_OR_NONTYPE T>
void DerivedT<T>::Inner() {
using K = BaseT<T>;
auto s = *this;
s.K::Foo();
} Looks like it goes back a while. |
Given the following code:
clang emits a unused typedef warning.
This is shown in abseil/abseil-cpp#1711.
The text was updated successfully, but these errors were encountered: