[clang] [Clang][Sema] Reject undeduced static data members without initializers (#173349) (PR #174281)
Yanzuo Liu via cfe-commits
cfe-commits at lists.llvm.org
Sun Jan 4 22:16:07 PST 2026
================
@@ -0,0 +1,11 @@
+// RUN: %clang_cc1 -fsyntax-only -verify -std=c++17 %s
+
+template <class T>
+struct A {
+ template <class U>
+ using E = U;
+
+ static E u; // expected-error {{declaration of variable 'u' with deduced type 'E' requires an initializer}}
----------------
zwuis wrote:
It would be nice to emit same diagnostic messages as the case that `E` and `u` are out of the definition of `A`.
```cpp
template <class U>
using E = U;
static E u;
```
https://github.com/llvm/llvm-project/pull/174281
More information about the cfe-commits
mailing list