llvmorg-github-actions[bot] wrote:

<!--LLVM PR SUMMARY COMMENT-->

@llvm/pr-subscribers-clang

Author: Macro Terra (hongtaihu)

<details>
<summary>Changes</summary>

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.

Validation: the complete restored file passes its original C++2a `-verify` RUN 
command twice with assertions enabled at 
90fd89ca9155697a1fa4dc2285a4876a8db5ad20. The source at the PR branch point 
matches the tested file before applying the four-line deletion.

Prepared with assistance from Codex.


---
Full diff: https://github.com/llvm/llvm-project/pull/240834.diff


1 Files Affected:

- (modified) clang/test/SemaTemplate/instantiate-static-local.cpp (-4) 


``````````diff
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
 }

``````````

</details>


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

Reply via email to