[all-commits] [llvm/llvm-project] 40081a: [libc++] Fix diagnostic for <stdatomic.h> before C...
Louis Dionne via All-commits
all-commits at lists.llvm.org
Mon Mar 4 15:25:04 PST 2024
Branch: refs/heads/main
Home: https://github.com/llvm/llvm-project
Commit: 40081a45a14f7aa6249fa034d961549c0b1762a0
https://github.com/llvm/llvm-project/commit/40081a45a14f7aa6249fa034d961549c0b1762a0
Author: Louis Dionne <ldionne.2 at gmail.com>
Date: 2024-03-04 (Mon, 04 Mar 2024)
Changed paths:
M libcxx/include/atomic
Log Message:
-----------
[libc++] Fix diagnostic for <stdatomic.h> before C++23 (#83351)
We normally try to issue a reasonable diagnostic when mixing
<stdatomic.h> and <atomic> before C++23. However, after granularizing
the <atomic> header, the check and the #error message was moved to
*after* the point where mixing both causes problems. When mixing both
headers, we would hence get the diagnostic burried under a pile of
previous diagnostics in e.g. __atomic/kill_dependency.h.
This patch moves the check earlier to restore the intended behavior. It
also switches from `#ifdef kill_dependency` to an explicit check of the
inclusion of the header and the Standard version, which seems to be more
reliable than checking whether a macro is defined.
To unsubscribe from these emails, change your notification settings at https://github.com/llvm/llvm-project/settings/notifications
More information about the All-commits
mailing list