From 301ffb1944a01d33d0b82c135f3c4a86e80fde2e Mon Sep 17 00:00:00 2001 From: Copilot <198982749+Copilot@users.noreply.github.com> Date: Mon, 4 Aug 2025 17:13:19 -0700 Subject: Fix #pragma warning not working with multifile modules (#7942) * Initial plan * Fix pragma warning not working with multifile modules - Check if DiagnosticSink already has a WarningStateTracker before creating new one - This preserves pragma warning state across __include'd files - Add regression tests for multifile pragma warnings Co-authored-by: csyonghe <2652293+csyonghe@users.noreply.github.com> * Add additional test cases for nested pragma warnings - Test nested __include scenarios with pragma warning directives - Verify pragma warnings work correctly with multiple levels of includes Co-authored-by: csyonghe <2652293+csyonghe@users.noreply.github.com> --------- Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com> Co-authored-by: csyonghe <2652293+csyonghe@users.noreply.github.com> Co-authored-by: Yong He --- tests/diagnostics/nested-pragma-impl2.slang | 10 ++++++++++ 1 file changed, 10 insertions(+) create mode 100644 tests/diagnostics/nested-pragma-impl2.slang (limited to 'tests/diagnostics/nested-pragma-impl2.slang') diff --git a/tests/diagnostics/nested-pragma-impl2.slang b/tests/diagnostics/nested-pragma-impl2.slang new file mode 100644 index 000000000..9a7e57562 --- /dev/null +++ b/tests/diagnostics/nested-pragma-impl2.slang @@ -0,0 +1,10 @@ +implementing nested_pragma_test; + +namespace impl2 +{ + interface IConvertibleFrom {} + + // This should also NOT produce warning 30856 due to outer pragma disable + extension, let N : int> + vector : IConvertibleFrom> {} +} \ No newline at end of file -- cgit v1.2.3