mirror of
https://github.com/KhronosGroup/OpenCL-CTS.git
synced 2026-03-19 06:09:01 +00:00
spir: Fix -Wcatch-value warnings (#1565)
`std::exception` and `std::runtime_error` are polymorphic types and as such they shouldn't be passed by value. Signed-off-by: Sven van Haastregt <sven.vanhaastregt@arm.com>
This commit is contained in:
committed by
GitHub
parent
c6bb15c289
commit
e9d2abf705
@@ -6253,7 +6253,7 @@ static bool test_image_enumeration(cl_context context, cl_command_queue queue,
|
||||
(FailE)(it.toString(), kernelName);
|
||||
std::cout << "enum_" << it.toString() << " FAILED" << std::endl;
|
||||
}
|
||||
} catch(std::exception e)
|
||||
} catch (const std::exception &e)
|
||||
{
|
||||
(FailE)(it.toString(), kernelName);
|
||||
print_error(1, e.what());
|
||||
@@ -6356,7 +6356,7 @@ static bool test_image_enumeration_3d(cl_context context, cl_command_queue queue
|
||||
(FailE)(it.toString(), kernelName);
|
||||
std::cout << "enum_" << it.toString() << " FAILED" << std::endl;
|
||||
}
|
||||
} catch(std::exception e)
|
||||
} catch (const std::exception &e)
|
||||
{
|
||||
(FailE)(it.toString(), kernelName);
|
||||
print_error(1, e.what());
|
||||
@@ -6521,7 +6521,7 @@ test_kernel_attributes(cl_device_id device, cl_uint width, const char *folder)
|
||||
}
|
||||
(SuccE)(test_name, "");
|
||||
log_info("kernel_attributes passed.\n");
|
||||
} catch(std::exception e)
|
||||
} catch (const std::exception &e)
|
||||
{
|
||||
(FailE)(test_name, "");
|
||||
log_info("kernel_attributes FAILED\n");
|
||||
@@ -6587,7 +6587,7 @@ static bool test_binary_type(cl_device_id device, cl_uint width, const char *fol
|
||||
}
|
||||
(SuccE)(test_name, "");
|
||||
log_info("binary_type passed.\n");
|
||||
} catch(std::exception e)
|
||||
} catch (const std::exception &e)
|
||||
{
|
||||
(FailE)(test_name, "");
|
||||
log_info("binary_type FAILED\n");
|
||||
|
||||
Reference in New Issue
Block a user