spaits wrote:

Currently, this patch also reports and error for this code:
```cpp
class SomeBase {};

struct S0 : SomeBase {
    S0(int) {}
    template <class T>
    S0(T) : Member(42), T(42) {};
    int Member{21};
};
```
Also the clang-tidy test case:
```

namespace gh192510 {
  template<typename T>
  struct C {

  };

  struct Base {  
    int x;
  };

  template<typename T>
  class X: public Base/*, private C<T>*/ {
    using INT = C<T>;

    X(INT i) : INT(i) {} // no crash
    // CHECK-MESSAGES: :[[@LINE-1]]:5: warning: constructor does not initialize 
these bases: Base
  };
}
```
Also gives an error.
If I understand it correctly, I shouldn't report an error, when the class has 
any base classes. But in that case I think the template types may still get 
down to the member initialization warning generation phase and we may still 
crash. I will check it out.

https://github.com/llvm/llvm-project/pull/201379
_______________________________________________
cfe-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to