From 28e147db1f23b16a1f1ebb7160c9cc1fc9fc3d70 Mon Sep 17 00:00:00 2001 From: David Justo Date: Sat, 18 Oct 2025 17:58:08 -0700 Subject: [PATCH] use `std::runtime_error` to construct `std::exception` from string --- .../test/asan/TestCases/Windows/basic_exception_handling.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/compiler-rt/test/asan/TestCases/Windows/basic_exception_handling.cpp b/compiler-rt/test/asan/TestCases/Windows/basic_exception_handling.cpp index 6f028147c9049..8d1b9ef17393f 100644 --- a/compiler-rt/test/asan/TestCases/Windows/basic_exception_handling.cpp +++ b/compiler-rt/test/asan/TestCases/Windows/basic_exception_handling.cpp @@ -7,13 +7,14 @@ // This code is based on the repro in https://github.com/google/sanitizers/issues/749 #include #include +#include -void throwInFunction() { throw std::exception("test2"); } +void throwInFunction() { throw std::runtime_error("test2"); } int main() { // case 1: direct throw try { - throw std::exception("test1"); + throw std::runtime_error("test1"); } catch (const std::exception &ex) { puts(ex.what()); // CHECK: test1