[clang] [Clang][Sema] Reject undeduced static data members without initializers (#173349) (PR #174281)

Yanzuo Liu via cfe-commits cfe-commits at lists.llvm.org
Mon Jan 5 19:11:09 PST 2026


zwuis wrote:

> > While we are here, could you handle the case that `u` has an initializer?
> 
> It is already handled 

We can refer to how it is handled.

```cpp
template <typename> struct A {
  template <typename U>
  using E = U;

  // both of them should be rejected
  static E u1;
  static E u2 = 0;
};
```

> Also, about moving to a separate file,  the file you mentioned uses `c++14`, while the whole issue is with `C++17, C++ 20, C++23.`, So I believe we should keep it in a separate file?

We can write multiple `// RUN` in one test file, each `// RUN` specifies different C++ versions.

https://github.com/llvm/llvm-project/pull/174281


More information about the cfe-commits mailing list