Issue 98878
Summary False positive of -Wunused-local-typedef in dependent code.
Labels clang:frontend
Assignees
Reporter hokein
    Given the following code:

```
#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>; 
  this->K::Foo(); 
}
```

clang emits a unused typedef warning.

```
⇒  ./bin/clang -Xclang  -fsyntax-only -Wunused-local-typedef  --std=c++20 /tmp/t2.cpp
/tmp/t2.cpp:15:9: warning: unused type alias 'K' [-Wunused-local-typedef]
   15 |   using K = BaseT<T>;
      |  
``` 

This is shown in https://github.com/abseil/abseil-cpp/pull/1711.

_______________________________________________
llvm-bugs mailing list
llvm-bugs@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-bugs

Reply via email to