This is an archive of the discontinued LLVM Phabricator instance.

Mark __c11_atomic_load as const
ClosedPublic

Authored by jfb on May 31 2018, 4:39 PM.

Details

Summary

C++11 onwards specs the non-member functions atomic_load and atomic_load_explicit as taking the atomic<T> by const (potentially volatile) pointer. C11, in its infinite wisdom, decided to drop the const, and C17 will fix this with DR459 (the current draft forgot to fix B.16, but that’s not the normative part).

This patch fixes the libc++ version of the __c11_atomic_load builtins defined for GCC's compatibility sake.

D47618 takes care of the clang side.

Discussion: http://lists.llvm.org/pipermail/cfe-dev/2018-May/058129.html

rdar://problem/27426936

Diff Detail

Repository
rL LLVM

Event Timeline

jfb created this revision.May 31 2018, 4:39 PM
EricWF accepted this revision.May 31 2018, 6:27 PM

LGTM.

This revision is now accepted and ready to land.May 31 2018, 6:27 PM
jfb edited the summary of this revision. (Show Details)May 31 2018, 9:56 PM
This revision was automatically updated to reflect the committed changes.