-
Notifications
You must be signed in to change notification settings - Fork 1.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
<algorithm>: fill fails to compile with volatile pointer inputs #1183
Comments
@AdamBucior , since it overlaps with your PR on review, thoughts? My understanding is that calling |
We should make this compile but I note that there's nothing useful you get from |
@BillyONeal , I think it can implement |
Implemented an easy fix in #1160. |
Should it have some test coverage? |
Think so, as this is highly unusual, possibly in a separate test. |
Separate test is definitely too much. I would add it to |
Added a simple test case. |
Fixes #1183. Co-authored-by: Alex Guteniev <gutenev@gmail.com> Co-authored-by: Stephan T. Lavavej <stl@microsoft.com>
Describe the bug
Passing volatile pointers to
fill
with arguments that satisfy_Fill_memset_is_safe
will fail to compile, as that branch callsmemset
which cannot take volatile pointers.Command-line test case
Expected behavior
The program should compile.
STL version
Additional context
Both GCC and Clang can compile this example, here's a godbolt link.
It will actually compile if you use
std::fill(beg, end, 0);
presumably because_Ty
is nowint
and_Fill_memset_is_safe
evaluates to false.The text was updated successfully, but these errors were encountered: