[clang] d9ff2ae - [Clang][NFC] Re-enable local-class static member diagnostic test (#240834)
via cfe-commits
cfe-commits at lists.llvm.org
Thu Nov 12 04:14:12 PST 2026
Author: Macro Terra
Date: 2026-11-12T20:14:06+08:00
New Revision: d9ff2ae303d278efd8fde8b6436580fdfdaebce1
URL: https://github.com/llvm/llvm-project/commit/d9ff2ae303d278efd8fde8b6436580fdfdaebce1
DIFF: https://github.com/llvm/llvm-project/commit/d9ff2ae303d278efd8fde8b6436580fdfdaebce1.diff
LOG: [Clang][NFC] Re-enable local-class static member diagnostic test (#240834)
Re-enable the local-class static data member example in
`clang/test/SemaTemplate/instantiate-static-local.cpp`. Keep its
existing `expected-error {{static}}`, remove the `#if 0` guard and stale
crash FIXME, and remove the conflicting `expected-no-diagnostics`
marker.
The crash was fixed by e2def106757534b07a2d3ff15ddd48e14b69a66d
(#182707). A targeted AArch64 snapshot search followed by native X86
assertions-on builds confirms the boundary: the parent
c1c4a5a870eb668fec480771c4d002e17362ed18 crashes in
`LocalInstantiationScope::findInstantiationOf` on both attempts, while
the fix emits only the expected illegal-static-member diagnostic and
exits normally on both attempts.
Prepared with assistance from Codex.
Added:
Modified:
clang/test/SemaTemplate/instantiate-static-local.cpp
Removed:
################################################################################
diff --git a/clang/test/SemaTemplate/instantiate-static-local.cpp b/clang/test/SemaTemplate/instantiate-static-local.cpp
index dd139011ac6bd..073176e25ae18 100644
--- a/clang/test/SemaTemplate/instantiate-static-local.cpp
+++ b/clang/test/SemaTemplate/instantiate-static-local.cpp
@@ -11,9 +11,6 @@ namespace use_after_instantiation {
auto &s = decltype(S())::value;
// This is ill-formed, but it should not crash.
- // FIXME: Right now, it does crash.
- // expected-no-diagnostics
-#if 0
template<typename = void> auto T() {
static int s;
struct A {
@@ -23,5 +20,4 @@ namespace use_after_instantiation {
}
auto &t = decltype(T())::value;
-#endif
}
More information about the cfe-commits
mailing list